summaryrefslogtreecommitdiff
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorVinnie Okada <vokada@mrvinn.com>2015-03-01 08:06:46 -0700
committerVinnie Okada <vokada@mrvinn.com>2015-03-07 13:11:08 -0700
commitcacac147de2b317d02788c5da1cdc6010f00a340 (patch)
tree079ba9eb2adb0d34c47205bd778066dda7ce3d60 /app/models/project.rb
parent3cf4359b00d13959741e8c4909112c21b021c86c (diff)
downloadgitlab-ce-cacac147de2b317d02788c5da1cdc6010f00a340.tar.gz
Move restricted visibility settings to the UI
Add checkboxes to the application settings page for restricted visibility levels, and remove those settings from gitlab.yml.
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index c45338bf4eb..16b68453f5c 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -34,6 +34,8 @@ require 'file_size_validator'
class Project < ActiveRecord::Base
include Sortable
+ include Gitlab::CurrentSettings
+ extend Gitlab::CurrentSettings
include Gitlab::ShellAdapter
include Gitlab::VisibilityLevel
include Gitlab::ConfigHelper
@@ -132,8 +134,8 @@ class Project < ActiveRecord::Base
validates :issues_enabled, :merge_requests_enabled,
:wiki_enabled, inclusion: { in: [true, false] }
validates :visibility_level,
- exclusion: { in: gitlab_config.restricted_visibility_levels },
- if: -> { gitlab_config.restricted_visibility_levels.any? }
+ exclusion: { in: current_application_settings.restricted_visibility_levels },
+ if: -> { current_application_settings.restricted_visibility_levels.any? }
validates :issues_tracker_id, length: { maximum: 255 }, allow_blank: true
validates :namespace, presence: true
validates_uniqueness_of :name, scope: :namespace_id