Merge branch 'zj-default-setting-features' into 'master'
Add default values for ProjectFeature See merge request !6447
This commit is contained in:
commit
4e7eb30923
1 changed files with 6 additions and 0 deletions
|
@ -22,6 +22,12 @@ class ProjectFeature < ActiveRecord::Base
|
|||
|
||||
belongs_to :project
|
||||
|
||||
default_value_for :builds_access_level, value: ENABLED, allows_nil: false
|
||||
default_value_for :issues_access_level, value: ENABLED, allows_nil: false
|
||||
default_value_for :merge_requests_access_level, value: ENABLED, allows_nil: false
|
||||
default_value_for :snippets_access_level, value: ENABLED, allows_nil: false
|
||||
default_value_for :wiki_access_level, value: ENABLED, allows_nil: false
|
||||
|
||||
def feature_available?(feature, user)
|
||||
raise ArgumentError, 'invalid project feature' unless FEATURES.include?(feature)
|
||||
|
||||
|
|
Loading…
Reference in a new issue