summaryrefslogtreecommitdiff
path: root/app/models/namespace.rb
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2017-08-29 12:15:19 +0200
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2017-08-31 09:27:42 +0200
commit04cd47dd5a08ca5cc84c44346b2893111da9594c (patch)
tree08876d2156c4538b9a028b0b0d02a45c1783f185 /app/models/namespace.rb
parent9e7e0496ff639d1eec65dcbf1b51edb2262456e2 (diff)
downloadgitlab-ce-04cd47dd5a08ca5cc84c44346b2893111da9594c.tar.gz
Don't show references to Pages when not available
In this instance its subgroups, and given we can't deploy it, we shouldn't allow it to be shown. Fixes gitlab-org/gitlab-ce#34864
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r--app/models/namespace.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index e7bc1d1b080..e7cbc5170e8 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -195,6 +195,10 @@ class Namespace < ActiveRecord::Base
parent.present?
end
+ def subgroup?
+ has_parent?
+ end
+
def soft_delete_without_removing_associations
# We can't use paranoia's `#destroy` since this will hard-delete projects.
# Project uses `pending_delete` instead of the acts_as_paranoia gem.