Commit 8eef877c authored by Alfredo Sumaran's avatar Alfredo Sumaran

Use snake_case for Ruby variables

parent fc8fa9bb
- defaultLabel = 'Select' - default_label = 'Select'
- dropdownLabel = defaultLabel - dropdown_label = default_label
%div{ class: "#{input_basic_name}-container" } %div{ class: "#{input_basic_name}-container" }
- if access_levels.present? - if access_levels.present?
- access_levels.map.with_index do |level, i| - access_levels.map.with_index do |level, i|
- if (level.type == :user) - if level.type == :user
- fieldKey = 'user_id' - field_key = 'user_id'
- value = level.user_id - value = level.user_id
- else - else
- fieldKey = 'access_level' - field_key = 'access_level'
- value = level.access_level - value = level.access_level
%input{ type: 'hidden', name: "protected_branch[#{input_basic_name}_attributes][#{i}][#{fieldKey}]", %input{ type: 'hidden', name: "protected_branch[#{input_basic_name}_attributes][#{i}][#{field_key}]",
value: value, data: { type: level.type, id: level.id } } value: value, data: { type: level.type, id: level.id } }
- dropdownLabel = [pluralize(level_frequencies[:role], 'role'), pluralize(level_frequencies[:user], 'user')].to_sentence - dropdown_label = [pluralize(level_frequencies[:role], 'role'), pluralize(level_frequencies[:user], 'user')].to_sentence
= dropdown_tag(dropdownLabel, options: { toggle_class: "#{toggle_class} js-multiselect", dropdown_class: 'dropdown-menu-user dropdown-menu-selectable', filter: true, = dropdown_tag(dropdown_label, options: { toggle_class: "#{toggle_class} js-multiselect", dropdown_class: 'dropdown-menu-user dropdown-menu-selectable', filter: true,
data: { default_label: defaultLabel } }) data: { default_label: default_label } })
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment