summaryrefslogtreecommitdiff
path: root/app/models/account.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/account.rb')
-rw-r--r--app/models/account.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index cf998e4..32ed445 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -16,9 +16,13 @@ class Account
# Returns the user record so it can be used in views.
def self.create(attrs)
- @user = User.create(attrs).tap do |user|
- Identity.create_for user
+ @user = User.create(attrs)
+ if @user.persisted?
+ identity = @user.identity
+ identity.user_id = @user.id
+ identity.save
end
+ return @user
end
def update(attrs)