Skip to content

Commit

Permalink
Do a more specific query in the fix rake task
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael committed Sep 16, 2010
1 parent bbc7492 commit dea0912
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/tasks/db.rake
Expand Up @@ -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
Expand Down

0 comments on commit dea0912

Please sign in to comment.