Merge branch 'zj-default-setting-features' into 'master'

Add default values for ProjectFeature

See merge request !6447
This commit is contained in:
Robert Speicher 2016-09-21 18:19:44 +00:00
commit 4e7eb30923

View file

@ -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)