diff options
Diffstat (limited to 'lib/gitlab/feature_categories.rb')
-rw-r--r-- | lib/gitlab/feature_categories.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gitlab/feature_categories.rb b/lib/gitlab/feature_categories.rb index d06f3b14fed..17586a94d7e 100644 --- a/lib/gitlab/feature_categories.rb +++ b/lib/gitlab/feature_categories.rb @@ -31,6 +31,14 @@ module Gitlab category end + def get!(feature_category) + return feature_category if valid?(feature_category) + + raise "Unknown feature category: #{feature_category}" if Gitlab.dev_or_test_env? + + FEATURE_CATEGORY_DEFAULT + end + def valid?(category) categories.include?(category.to_s) end |