Skip to content
Snippets Groups Projects
Commit c8f864a6 authored by Raphael's avatar Raphael
Browse files

Finish fixing move_private_key

parent a372ec33
No related branches found
No related tags found
No related merge requests found
......@@ -69,12 +69,12 @@ namespace :db do
task :move_private_key do
require File.dirname(__FILE__) + '/../../config/environment'
User.all.each do |user|
if user.private_key.nil?
user.private_key = user.person.serialized_key
if user.serialized_private_key.nil?
user.serialized_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.serialized_public_key = user.encryption_key.public_key.to_s
person.save
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment