summaryrefslogtreecommitdiff
path: root/app/models/concerns/issuable.rb
diff options
context:
space:
mode:
authormicael.bergeron <micael.bergeron@solutionstlm.com>2017-07-29 11:04:42 -0400
committermicael.bergeron <micael.bergeron@solutionstlm.com>2017-09-06 09:00:57 -0400
commit966b1128d884a318dad4277e23368334fe67e836 (patch)
treec0007ce9697dfe0fe93b52e619e21e8341c35120 /app/models/concerns/issuable.rb
parent8fe1aa5dbbb41cdefffb7177d9eda44ac8652cc7 (diff)
downloadgitlab-ce-966b1128d884a318dad4277e23368334fe67e836.tar.gz
WIP: refactor the first-contributor to Issuable
this will remove the need make N queries (per-note) at the cost of having to mark notes with an attribute this opens up the possibility for other special roles for notes
Diffstat (limited to 'app/models/concerns/issuable.rb')
-rw-r--r--app/models/concerns/issuable.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb
index 681c3241dbb..7b1c4e7a2d5 100644
--- a/app/models/concerns/issuable.rb
+++ b/app/models/concerns/issuable.rb
@@ -334,4 +334,9 @@ module Issuable
metrics = self.metrics || create_metrics
metrics.record!
end
+
+ def first_contribution?
+ return false if project.team.max_member_access(author_id) > Gitlab::Access::GUEST
+ project.merge_requests.merged.where(author_id: author_id).empty?
+ end
end