From dea0912c283967236374e9828e14a023294f95a8 Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 16 Sep 2010 16:41:28 -0700 Subject: [PATCH] Do a more specific query in the fix rake task --- lib/tasks/db.rake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index 56eddb266..22f995325 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -59,10 +59,13 @@ namespace :db do puts "fixing the people in this seed" require 'config/environment' - people = Person.all + people = Person.all( '$where' => "function(){ + return this.diaspora_handle.charAt(this.diaspora_handle.length-1) == '@' + }") people.each do |person| - if person.diaspora_handle[-1, 1]=='@' && person.owner.nil? == false + if person.owner + puts "Resetting diaspora handle for #{person.owner.username}" person.diaspora_handle = person.owner.diaspora_handle person.save end