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.
educoder/app/models/team_member.rb

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) }
5 years ago
def creator?
role == 1
end
def en_role
is_teacher? ? 'teacher' : 'member'
end
end