diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-03-13 18:16:51 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-03-15 15:49:41 +0300 |
commit | 99f995755ef4b445216dd7baae35f5a4846ef30c (patch) | |
tree | 1fdbd02c7cffc2f21faefaa80dea43f6cebecb0a /lib/api | |
parent | 60df262c38d7c235b483cc1c4beb12f793e0e58a (diff) |
Use `group_member` instead of `users_group` or `membership`.
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/group_members.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/api/group_members.rb b/lib/api/group_members.rb index c9c9ccbcb2e..ed54c7f6ff0 100644 --- a/lib/api/group_members.rb +++ b/lib/api/group_members.rb @@ -53,14 +53,14 @@ module API authorize! :manage_group, group required_attributes! [:access_level] - team_member = group.group_members.find_by(user_id: params[:user_id]) - not_found!('User can not be found') if team_member.nil? + group_member = group.group_members.find_by(user_id: params[:user_id]) + not_found!('User can not be found') if group_member.nil? - if team_member.update_attributes(access_level: params[:access_level]) - @member = team_member.user + if group_member.update_attributes(access_level: params[:access_level]) + @member = group_member.user present @member, with: Entities::GroupMember, group: group else - handle_member_errors team_member.errors + handle_member_errors group_member.errors end end |