Commit 4e7eb309 authored by Robert Speicher's avatar Robert Speicher

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

Add default values for ProjectFeature

See merge request !6447
parents b3efa397 95730019
...@@ -22,6 +22,12 @@ class ProjectFeature < ActiveRecord::Base ...@@ -22,6 +22,12 @@ class ProjectFeature < ActiveRecord::Base
belongs_to :project 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) def feature_available?(feature, user)
raise ArgumentError, 'invalid project feature' unless FEATURES.include?(feature) raise ArgumentError, 'invalid project feature' unless FEATURES.include?(feature)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment