diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-03 21:06:49 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-03 21:06:49 +0300 |
commit | ab7cf450ba19cf80b9534f25dc707b33845e3014 (patch) | |
tree | bbfa6aba83c48aea68d79c4179ce576b6eec326d /app/models/milestone.rb | |
parent | 4204cf308596e0e26f578a6e2da88f49c0f4aad9 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/milestone.rb')
-rw-r--r-- | app/models/milestone.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/milestone.rb b/app/models/milestone.rb index d0be54eed02..d29eb62af7a 100644 --- a/app/models/milestone.rb +++ b/app/models/milestone.rb @@ -274,6 +274,16 @@ class Milestone < ApplicationRecord project_id.present? end + def merge_requests_enabled? + if group_milestone? + # Assume that groups have at least one project with merge requests enabled. + # Otherwise, we would need to load all of the projects from the database. + true + elsif project_milestone? + project&.merge_requests_enabled? + end + end + private # Milestone titles must be unique across project milestones and group milestones |