Redefine user roles with their role in a study group

This commit is contained in:
Sebastian Serth
2022-09-20 16:19:04 +02:00
committed by Sebastian Serth
parent 04ed45ea73
commit 9c9f45ff77
12 changed files with 90 additions and 44 deletions

View File

@ -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