summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorankonym <ankonym@gmail.com>2015-10-08 17:00:04 +0200
committerankonym <ankonym@gmail.com>2015-10-13 11:46:02 +0200
commit2541d08598c2bc4ce04f63b4ed4056ffb044a596 (patch)
treec66fc44b1e61ad57051ba99b067bc6c2dc83d799 /app/models
parent76cc852527a117e1cbff7f2ea80afa9033abb422 (diff)
Fix the InviteCode initialize method so leap_web tests stay green
Diffstat (limited to 'app/models')
-rw-r--r--app/models/invite_code.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/invite_code.rb b/app/models/invite_code.rb
index 8f69582..701b663 100644
--- a/app/models/invite_code.rb
+++ b/app/models/invite_code.rb
@@ -13,6 +13,8 @@ class InviteCode < CouchRest::Model::Base
def initialize(attributes = {}, options = {})
super(attributes, options)
+ write_attribute('invite_code', CouponCode.generate) if new?
+
end
def set_invite_code(code)