Module: SimpleTeams::MemberObject

Extended by:
ActiveSupport::Concern
Defined in:
app/models/concerns/simple_teams/member_object.rb

Instance Method Summary collapse

Instance Method Details

#member_of_team?(team) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'app/models/concerns/simple_teams/member_object.rb', line 10

def member_of_team?(team)
  team_memberships.where(team: team).present?
end

#membership_for_team(team) ⇒ Object



14
15
16
# File 'app/models/concerns/simple_teams/member_object.rb', line 14

def membership_for_team(team)
  team_memberships.find_by(:team_id => team.id)
end

#role_for_team(team) ⇒ Object



18
19
20
# File 'app/models/concerns/simple_teams/member_object.rb', line 18

def role_for_team(team)
  membership_for_team(team).role if membership_for_team(team).present?
end