You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
327 B
16 lines
327 B
class TeamMember < ApplicationRecord
|
|
belongs_to :user
|
|
belongs_to :competition
|
|
belongs_to :competition_team
|
|
|
|
scope :only_teachers, -> { where(is_teacher: true) }
|
|
scope :without_teachers, -> { where(is_teacher: false) }
|
|
|
|
def creator?
|
|
role == 1
|
|
end
|
|
|
|
def en_role
|
|
is_teacher? ? 'teacher' : 'member'
|
|
end
|
|
end |