Skip to content
Browse files

MS rake task to fix broken local people.... let me test it first on a…

… server, but then you can run rake db:fix_diaspora_handle
  • Loading branch information...
1 parent e7afebe commit 1e8f10f1af71dc16b57b35178256ad257c16b614 @maxwell maxwell committed Sep 16, 2010
Showing with 16 additions and 0 deletions.
  1. +16 −0 lib/tasks/db.rake
View
16 lib/tasks/db.rake
@@ -22,6 +22,7 @@ namespace :db do
require 'db/seeds/backer'
create
end
+
end
desc 'Delete the collections in the current RAILS_ENV database'
@@ -53,4 +54,19 @@ namespace :db do
Rake::Task['db:seed:dev'].invoke
puts "you did it!"
end
+
+ task :fix_diaspora_handle do
+ puts "fixing the people in this seed"
+ require 'config/environment'
+
+ people = Person.all
+
+ people.each do |person|
+ if person.diaspora_handle[-1, 1]=='@' && person.owner.nil? == false
+ person.diaspora_handle = person.owner.diaspora_handle
+ person.save
+ end
+ end
+ puts "everything should be peachy"
+ end
end

0 comments on commit 1e8f10f

Please sign in to comment.
Something went wrong with that request. Please try again.