Add and apply Style/MapIntoArray rubocop rule
This rule was added in rubocop 1.63.0.
This commit is contained in:
@@ -715,6 +715,9 @@ Style/InvertibleUnlessCondition:
|
|||||||
Style/LineEndConcatenation:
|
Style/LineEndConcatenation:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Style/MapIntoArray:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Style/MapToHash:
|
Style/MapToHash:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
module OfficingHelper
|
module OfficingHelper
|
||||||
def booths_for_officer_select_options(officer_assignments)
|
def booths_for_officer_select_options(officer_assignments)
|
||||||
options = []
|
options = officer_assignments.map do |oa|
|
||||||
officer_assignments.each do |oa|
|
[oa.booth_assignment.booth.name.to_s, oa.id]
|
||||||
options << [oa.booth_assignment.booth.name.to_s, oa.id]
|
|
||||||
end
|
end
|
||||||
options.sort_by! { |x| x[0] }
|
options.sort_by! { |x| x[0] }
|
||||||
options_for_select(options, params[:oa])
|
options_for_select(options, params[:oa])
|
||||||
|
|||||||
@@ -191,14 +191,12 @@ class MachineLearning
|
|||||||
end
|
end
|
||||||
|
|
||||||
def scripts_info
|
def scripts_info
|
||||||
scripts_info = []
|
Dir[SCRIPTS_FOLDER.join("*.py")].map do |full_path_filename|
|
||||||
Dir[SCRIPTS_FOLDER.join("*.py")].each do |full_path_filename|
|
{
|
||||||
scripts_info << {
|
|
||||||
name: full_path_filename.split("/").last,
|
name: full_path_filename.split("/").last,
|
||||||
description: description_from(full_path_filename)
|
description: description_from(full_path_filename)
|
||||||
}
|
}
|
||||||
end
|
end.sort_by { |script_info| script_info[:name] }
|
||||||
scripts_info.sort_by { |script_info| script_info[:name] }
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def description_from(script_filename)
|
def description_from(script_filename)
|
||||||
|
|||||||
Reference in New Issue
Block a user