summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/helpers/projects_helper.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index 109738b57eb..43669b6f356 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -430,19 +430,17 @@ module ProjectsHelper
end
def visibility_select_options(project, selected_level)
- levels_options_array = []
-
- Gitlab::VisibilityLevel.values.each do |level|
+ level_options = Gitlab::VisibilityLevel.values.each_with_object([]) do |level, level_options|
next if restricted_levels.include?(level)
- levels_options_array << [
+ level_options << [
visibility_level_label(level),
{ data: { description: visibility_level_description(level, project) } },
level
]
end
- options_for_select(levels_options_array, selected_level)
+ options_for_select(level_options, selected_level)
end
def restricted_levels