summaryrefslogtreecommitdiff
path: root/app/models/invite_code.rb
diff options
context:
space:
mode:
authorankonym <ankonym@gmail.com>2015-10-02 16:51:57 +0200
committerankonym <ankonym@gmail.com>2015-10-02 16:51:57 +0200
commit82a33300818dd8f6e06856944fe7c658746efca1 (patch)
treea38234fa3a6e4cca22ad1f7b7a42743a19ec96d4 /app/models/invite_code.rb
parentd45f6c61f6a13be06f1977b857e0cb31e79c5317 (diff)
Allow multi-use invite codes
Introduce a invite_max_uses property to invite codes to allow admins to set a maximum number of uses for invite codes.
Diffstat (limited to 'app/models/invite_code.rb')
-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 30a6498..0086804 100644
--- a/app/models/invite_code.rb
+++ b/app/models/invite_code.rb
@@ -4,12 +4,14 @@ class InviteCode < CouchRest::Model::Base
use_database 'invite_codes'
property :invite_code, String, :read_only => true
property :invite_count, Integer, :default => 0, :accessible => true
+ property :invite_max_uses, Integer, :default => 1, :accessible => true
timestamps!
design do
view :by_invite_code
view :by_invite_count
+ view :by_invite_max_uses
end
def initialize(attributes = {}, options = {})