diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-18 13:50:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-18 13:50:51 +0300 |
commit | db384e6b19af03b4c3c82a5760d83a3fd79f7982 (patch) | |
tree | 34beaef37df5f47ccbcf5729d7583aae093cffa0 /app/models/concerns/milestoneable.rb | |
parent | 54fd7b1bad233e3944434da91d257fa7f63c3996 (diff) |
Add latest changes from gitlab-org/gitlab@16-3-stable-eev16.3.0-rc42
Diffstat (limited to 'app/models/concerns/milestoneable.rb')
-rw-r--r-- | app/models/concerns/milestoneable.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/concerns/milestoneable.rb b/app/models/concerns/milestoneable.rb index e95a8a42aa6..b72d99d211c 100644 --- a/app/models/concerns/milestoneable.rb +++ b/app/models/concerns/milestoneable.rb @@ -52,7 +52,9 @@ module Milestoneable def milestone_available? return true if milestone_id.blank? - project_id == milestone&.project_id || project.ancestors_upto.compact.include?(milestone&.group) + (project_id.present? && project_id == milestone&.project_id) || + try(:namespace)&.self_and_ancestors&.include?(milestone&.group) || + project&.ancestors_upto&.compact&.include?(milestone&.group) end ## |