summaryrefslogtreecommitdiff
path: root/app/models/account.rb
diff options
context:
space:
mode:
authorankonym <ankonym@gmail.com>2015-08-25 14:11:00 +0200
committerankonym <ankonym@gmail.com>2015-09-28 15:12:45 +0200
commit45c3fadd930a474951bd918a50e1ea2b00af75c7 (patch)
tree3439fc94cc8e6533a92d06a2fd751a3804e71050 /app/models/account.rb
parent5f9aec72f124a971b765c14052363f3ce1e16c65 (diff)
Make sure codes can only be used once, fix validations
We introduced a count on invite codes to make sure that (at the moment) codes can only be used once. (The code will also allow multi-use codes in the future.) Also, some of our validations weren't validating against the correct data, which is now fixed.
Diffstat (limited to 'app/models/account.rb')
-rw-r--r--app/models/account.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index af470ed..a57e3f7 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -1,7 +1,7 @@
#
-# The Account model takes care of the livecycle of a user.
+# The Account model takes care of the lifecycle of a user.
# It composes a User record and it's identity records.
-# It also allows for other engines to hook into the livecycle by
+# It also allows for other engines to hook into the lifecycle by
# monkeypatching the create, update and destroy methods.
# There's an ActiveSupport load_hook at the end of this file to
# make this more easy.
@@ -19,6 +19,7 @@ class Account
identity = nil
user = nil
user = User.new(attrs)
+
user.save
if !user.tmp? && user.persisted?
identity = user.identity