diff options
Diffstat (limited to 'app/helpers/namespaces_helper.rb')
-rw-r--r-- | app/helpers/namespaces_helper.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/app/helpers/namespaces_helper.rb b/app/helpers/namespaces_helper.rb index ea3bcfc791a..44b58b702d9 100644 --- a/app/helpers/namespaces_helper.rb +++ b/app/helpers/namespaces_helper.rb @@ -11,10 +11,10 @@ module NamespacesHelper selected_id = selected unless extra_group.nil? || extra_group.is_a?(Group) - extra_group = Group.find(extra_group) if Namespace.find(extra_group).kind == 'group' + extra_group = Group.find(extra_group) if Namespace.find(extra_group).kind == "group" end - if extra_group && extra_group.is_a?(Group) + if extra_group&.is_a?(Group) extra_group = dedup_extra_group(extra_group) if Ability.allowed?(current_user, :read_group, extra_group) @@ -28,10 +28,10 @@ module NamespacesHelper end options = [] - options << options_for_group(groups, display_path: display_path, type: 'group') + options << options_for_group(groups, display_path: display_path, type: "group") unless groups_only - options << options_for_group(users, display_path: display_path, type: 'user') + options << options_for_group(users, display_path: display_path, type: "user") if selected == :current_user && current_user.namespace selected_id = current_user.namespace.id @@ -66,17 +66,17 @@ module NamespacesHelper def options_for_group(namespaces, display_path:, type:) group_label = type.pluralize - elements = namespaces.sort_by(&:human_name).map! do |n| + elements = namespaces.sort_by(&:human_name).map! { |n| [display_path ? n.full_path : n.human_name, n.id, data: { options_parent: group_label, visibility_level: n.visibility_level_value, visibility: n.visibility, name: n.name, - show_path: (type == 'group') ? group_path(n) : user_path(n), - edit_path: (type == 'group') ? edit_group_path(n) : nil - }] - end + show_path: type == "group" ? group_path(n) : user_path(n), + edit_path: type == "group" ? edit_group_path(n) : nil, + },] + } [group_label.camelize, elements] end |