Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
078b78a09527
Commit
9747f3ef
authored
Sep 21, 2016
by
Z.J. van de Weg
Browse files
Add default values for ProjectFeature
Closes gitlab-org/gitlab-ce#22330
parent
002cee3b5e39
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/models/project_feature.rb
View file @
078b78a0
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment