summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorankonym <ankonym@gmail.com>2015-10-08 15:37:27 +0200
committerankonym <ankonym@gmail.com>2015-10-13 11:46:02 +0200
commit76cc852527a117e1cbff7f2ea80afa9033abb422 (patch)
treea7f017c06369e4374483a43726880273547a3eb0 /app
parent70073b1ac48f96d3e375630fb7f3904351e0f696 (diff)
Adjust the rake task to make id = invite code
This will simplify invite code deletion after running tests.
Diffstat (limited to 'app')
-rw-r--r--app/models/invite_code.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/invite_code.rb b/app/models/invite_code.rb
index 30a6498..8f69582 100644
--- a/app/models/invite_code.rb
+++ b/app/models/invite_code.rb
@@ -1,4 +1,3 @@
-require 'coupon_code'
class InviteCode < CouchRest::Model::Base
use_database 'invite_codes'
@@ -14,9 +13,11 @@ 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)
+ write_attribute(:invite_code, code)
+ end
end