Skip to content

Commit

Permalink
Rename variables invitee to inviter in invitation.rb.
Browse files Browse the repository at this point in the history
  • Loading branch information
yangsong8 committed Aug 23, 2015
1 parent 8c229fa commit 1b2fc1f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/models/invitation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def self.update_users_topic_after_invite_accept(invitee_user_id, invited_user_id
#team and topics that the old team signed up for will be deleted.
#Then invites the user that accepted the invite sent will be removed.
#Last the users team entry will be added to the TeamsUser table and their assigned topic is updated
def self.accept_invite(team_id, invitee_user_id, invited_user_id, assignment_id)
def self.accept_invite(team_id, inviter_user_id, invited_user_id, assignment_id)
#if you are on a team and you accept another invitation and if your old team does not have any members, delete the entry for the team
if TeamsUser.is_team_empty(team_id) and team_id != '0'
assignment_id = AssignmentTeam.find(team_id).assignment.id
Expand All @@ -56,10 +56,11 @@ def self.accept_invite(team_id, invitee_user_id, invited_user_id, assignment_id)

#Create a new team_user entry for the accepted invitation
@team_user = TeamsUser.new
can_add_member = TeamsUser.add_member_to_invited_team(invitee_user_id, invited_user_id, assignment_id)
can_add_member = TeamsUser.add_member_to_invited_team(inviter_user_id, invited_user_id, assignment_id)

if can_add_member # The member was successfully added to the team (the team was not full)
Invitation.update_users_topic_after_invite_accept(invitee_user_id, invited_user_id, assignment_id)
Invitation.update_users_topic_after_invite_accept(inviter_user_id, invited_user_id, assignment_id)

end

return can_add_member
Expand Down

0 comments on commit 1b2fc1f

Please sign in to comment.