VRFS-194: added can_invite attribute, defaults to true, but false for invited users
This commit is contained in:
parent
2c4e550910
commit
7d1e7417ed
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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?
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
|
|
|
|||
Loading…
Reference in New Issue