summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-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)