diff options
author | James Lopez <james.lopez@vodafone.com> | 2015-10-29 16:10:27 +0000 |
---|---|---|
committer | James Lopez <james.lopez@vodafone.com> | 2015-10-29 16:10:27 +0000 |
commit | de990aa15829d0ab182ad5a55b4c527846c0d39c (patch) | |
tree | 8a4feb62b5f4b6f03d5fe03a0ff3ee9e99815f17 /app/models/member.rb | |
parent | 0ea38dc519b86d2bd2e14f1df1baf0fffc043af6 (diff) | |
download | gitlab-ce-de990aa15829d0ab182ad5a55b4c527846c0d39c.tar.gz |
fixed last group owner issue and added test
Diffstat (limited to 'app/models/member.rb')
-rw-r--r-- | app/models/member.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/models/member.rb b/app/models/member.rb index cae8caa23fb..bc7e70178e1 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -81,11 +81,12 @@ class Member < ActiveRecord::Base member = members.build member.invite_email = user end + if !current_user || current_user.can?(:update_group_member, member) + member.created_by ||= current_user + member.access_level = access_level - member.created_by ||= current_user - member.access_level = access_level - - member.save + member.save + end end end |