diff options
Diffstat (limited to 'app/models/account.rb')
-rw-r--r-- | app/models/account.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/models/account.rb b/app/models/account.rb index c398d93..a5cd833 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -28,9 +28,12 @@ class Account identity.errors.each do |attr, msg| user.errors.add(attr, msg) end - user_invite_code = InviteCode.find_by_invite_code user.invite_code - user_invite_code.invite_count += 1 - user_invite_code.save + + if APP_CONFIG[:invite_required] + user_invite_code = InviteCode.find_by_invite_code user.invite_code + user_invite_code.invite_count += 1 + user_invite_code.save + end end rescue StandardError => ex user.errors.add(:base, ex.to_s) if user |