diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-04-10 14:46:09 +0200 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-04-14 12:06:42 +0200 |
commit | 2b2bd402dcee427a43de771036b348e156fea6c9 (patch) | |
tree | 0f4e7723cf6bf22a08197fccb0320c87361799d4 /app/models/members | |
parent | 1e97864958b5ee7cb92a6d45ceab6b6e476c5e7e (diff) | |
download | gitlab-ce-2b2bd402dcee427a43de771036b348e156fea6c9.tar.gz |
Track who created a group or project member.
Diffstat (limited to 'app/models/members')
-rw-r--r-- | app/models/members/project_member.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/members/project_member.rb b/app/models/members/project_member.rb index 6b13e0ff30b..2205041cd51 100644 --- a/app/models/members/project_member.rb +++ b/app/models/members/project_member.rb @@ -55,7 +55,7 @@ class ProjectMember < Member # :master # ) # - def add_users_into_projects(project_ids, user_ids, access) + def add_users_into_projects(project_ids, user_ids, access, current_user = nil) access_level = if roles_hash.has_key?(access) roles_hash[access] elsif roles_hash.values.include?(access.to_i) @@ -69,6 +69,7 @@ class ProjectMember < Member user_ids.each do |user_id| member = ProjectMember.new(access_level: access_level, user_id: user_id) member.source_id = project_id + member.created_by ||= current_user member.save end end |