From 9747f3ef7b34be5c104ad1a1ff541288274abc8e Mon Sep 17 00:00:00 2001 From: "Z.J. van de Weg" Date: Wed, 21 Sep 2016 13:10:27 +0300 Subject: Add default values for ProjectFeature Closes gitlab-org/gitlab-ce#22330 --- app/models/project_feature.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'app/models/project_feature.rb') diff --git a/app/models/project_feature.rb b/app/models/project_feature.rb index 9c602c582bd..6f5eb43be0f 100644 --- a/app/models/project_feature.rb +++ b/app/models/project_feature.rb @@ -22,6 +22,13 @@ class ProjectFeature < ActiveRecord::Base belongs_to :project + default_value_for :builds_access_level, value: ENABLED, allows_nil: false + default_value_for :merge_requests_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) -- cgit v1.2.3