From 494f765066204e92c685f990a41f988bc1b53ab0 Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 22 Sep 2010 22:57:53 -0700 Subject: [PATCH] fix_diaspora_handle rake task --- lib/tasks/db.rake | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index 80e3bafe5..32aabc0db 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -58,19 +58,12 @@ namespace :db do task :fix_diaspora_handle do puts "fixing the people in this seed" require 'config/environment' - - people = Person.all( '$where' => "function(){ - return this.diaspora_handle.charAt(this.diaspora_handle.length-1) == '@' - }") - - puts "Found #{people.count} people with broken diaspora_handle fields" - people.each do |person| + Person.where(:url => 'example.org').all.each{|person| if person.owner - puts "Resetting diaspora handle for #{person.owner.username}" + person.url = APP_CONFIG[:pod_url] person.diaspora_handle = person.owner.diaspora_handle - person.save end - end + } puts "everything should be peachy" end end