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:
|
||||
Enabled: true
|
||||
|
||||
Style/MapIntoArray:
|
||||
Enabled: true
|
||||
|
||||
Style/MapToHash:
|
||||
Enabled: true
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
module OfficingHelper
|
||||
def booths_for_officer_select_options(officer_assignments)
|
||||
options = []
|
||||
officer_assignments.each do |oa|
|
||||
options << [oa.booth_assignment.booth.name.to_s, oa.id]
|
||||
options = officer_assignments.map do |oa|
|
||||
[oa.booth_assignment.booth.name.to_s, oa.id]
|
||||
end
|
||||
options.sort_by! { |x| x[0] }
|
||||
options_for_select(options, params[:oa])
|
||||
|
||||
@@ -191,14 +191,12 @@ class MachineLearning
|
||||
end
|
||||
|
||||
def scripts_info
|
||||
scripts_info = []
|
||||
Dir[SCRIPTS_FOLDER.join("*.py")].each do |full_path_filename|
|
||||
scripts_info << {
|
||||
Dir[SCRIPTS_FOLDER.join("*.py")].map do |full_path_filename|
|
||||
{
|
||||
name: full_path_filename.split("/").last,
|
||||
description: description_from(full_path_filename)
|
||||
}
|
||||
end
|
||||
scripts_info.sort_by { |script_info| script_info[:name] }
|
||||
end.sort_by { |script_info| script_info[:name] }
|
||||
end
|
||||
|
||||
def description_from(script_filename)
|
||||
|
||||
Reference in New Issue
Block a user