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.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index bffa288..32ed445 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -16,10 +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.refresh_identity
+ @user = User.create(attrs)
+ if @user.persisted?
+ identity = @user.identity
+ identity.user_id = @user.id
+ identity.save
end
+ return @user
end
def update(attrs)