diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-03 12:09:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-03 12:09:50 +0300 |
commit | 29761d24b86b7a091ca83df4e8cd1cc14f81d534 (patch) | |
tree | eb77242b6d1685f14428caad63edd10e71502d02 /app/models/merge_request.rb | |
parent | 74081733481d7d3d480a5e887ac768fe30f84055 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/merge_request.rb')
-rw-r--r-- | app/models/merge_request.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index c3121851700..a8ec965581a 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -193,6 +193,7 @@ class MergeRequest < ApplicationRecord before_transition any => :merged do |merge_request| merge_request.merge_error = nil + merge_request.metrics.first_contribution = true if merge_request.first_contribution? end after_transition any => :opened do |merge_request| @@ -1907,6 +1908,7 @@ class MergeRequest < ApplicationRecord # rubocop: enable CodeReuse/ServiceClass def first_contribution? + return metrics&.first_contribution if merged? & metrics.present? return false if project.team.max_member_access(author_id) > Gitlab::Access::GUEST !project.merge_requests.merged.exists?(author_id: author_id) |