diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/namespace.rb | 4 | ||||
-rw-r--r-- | app/models/project.rb | 4 |
2 files changed, 8 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. diff --git a/app/models/project.rb b/app/models/project.rb index d5324ceac31..db7183e4c9a 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -1235,6 +1235,10 @@ class Project < ActiveRecord::Base File.join(pages_path, 'public') end + def pages_available? + Gitlab.config.pages.enabled && !namespace.subgroup? + end + def remove_private_deploy_keys exclude_keys_linked_to_other_projects = <<-SQL NOT EXISTS ( |