Redefine user roles with their role in a study group
This commit is contained in:

committed by
Sebastian Serth

parent
04ed45ea73
commit
9c9f45ff77
@ -10,7 +10,6 @@ class InternalUser < User
|
||||
validates :email, presence: true, uniqueness: true
|
||||
validates :password, confirmation: true, if: -> { password_void? && validate_password? }, on: :update, presence: true
|
||||
validate :password_strength, if: -> { password_void? && validate_password? }, on: :update
|
||||
validates :role, inclusion: {in: ROLES}
|
||||
|
||||
def activated?
|
||||
activation_state == 'active'
|
||||
@ -33,10 +32,6 @@ class InternalUser < User
|
||||
errors.add(:password, :weak) if result.score < 4
|
||||
end
|
||||
|
||||
def teacher?
|
||||
role == 'teacher'
|
||||
end
|
||||
|
||||
def displayname
|
||||
name
|
||||
end
|
||||
|
Reference in New Issue
Block a user