rake task to move the private key

This commit is contained in:
ilya 2010-09-28 11:25:18 -07:00
parent 263615ad14
commit 904143d100
2 changed files with 13 additions and 1 deletions

View file

@ -65,4 +65,17 @@ namespace :db do
}
puts "everything should be peachy"
end
task :move_private_key do
User.all.each do |user|
if user.private_key.nil?
user.private_key = user.person.serialized_key
user.save
person = user.person
person.serialized_key = nil
person.serialized_public_key = user.encryption_key.public_key
person.save
end
end
end
end

View file

@ -19,7 +19,6 @@ namespace :generate do
Rails.application.config.secret_token = '#{secret}'
EOF
puts "YAY!!"
end
end