VRFS-194: added can_invite attribute, defaults to true, but false for invited users

This commit is contained in:
Jonathan Kolyer 2013-01-04 04:13:39 -06:00
parent 2c4e550910
commit 7d1e7417ed
3 changed files with 7 additions and 1 deletions

View File

@ -12,4 +12,7 @@ module Limits
MIN_INSTRUMENTS_PER_MUSICIAN = 1
MAX_INSTRUMENTS_PER_MUSICIAN = 5
end
# users
USERS_CAN_INVITE = false # in BETA release, only first level users can invite others
end

View File

@ -500,6 +500,8 @@ module JamRuby
user.signup_token = SecureRandom.urlsafe_base64
user.can_invite = Limits::USERS_CAN_INVITE
user.save
if user.errors.any?

View File

@ -18,6 +18,7 @@ describe User do
it { should respond_to(:remember_token) }
it { should respond_to(:admin) }
it { should respond_to(:authenticate) }
it { should respond_to(:can_invite) }
it { should be_valid }
it { should_not be_admin }