opts[:person] set to empty hash only if not already defined. same with opts[:person][:profile]. rake db:reset works properly again.

This commit is contained in:
danielvincent 2010-10-27 18:34:51 -07:00
parent 1d5b7a87f1
commit 59858cd86b

View file

@ -407,14 +407,14 @@ class User
###Helpers############
def self.build(opts = {})
opts[:person] = {}
opts[:person] ||= {}
opts[:person][:profile] ||= Profile.new
opts[:person][:diaspora_handle] = "#{opts[:username]}@#{APP_CONFIG[:terse_pod_url]}"
opts[:person][:url] = APP_CONFIG[:pod_url]
opts[:serialized_private_key] = generate_key
opts[:person][:serialized_public_key] = opts[:serialized_private_key].public_key
opts[:person][:profile] = Profile.new
u = User.new(opts)
u