Style Rails/ToFormattedS

This commit is contained in:
Maikel Linke
2023-04-14 16:32:39 +10:00
parent b19df0dfbf
commit dad4061ff9
4 changed files with 3 additions and 13 deletions

View File

@@ -1334,16 +1334,6 @@ Rails/TimeZone:
- 'spec/models/spree/tax_rate_spec.rb'
- 'spec/services/customer_order_cancellation_spec.rb'
# Offense count: 3
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: to_fs, to_formatted_s
Rails/ToFormattedS:
Exclude:
- 'app/controllers/admin/variant_overrides_controller.rb'
- 'app/controllers/spree/admin/products_controller.rb'
- 'spec/system/admin/product_import_spec.rb'
# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/ToSWithArgument:

View File

@@ -63,7 +63,7 @@ module Admin
options = [{ id: '0', name: 'All' }]
import_dates.collect(&:import_date).map { |i|
options.push(id: i.to_date, name: i.to_date.to_formatted_s(:long))
options.push(id: i.to_date, name: i.to_date.to_fs(:long))
}
options

View File

@@ -177,7 +177,7 @@ module Spree
def product_import_dates
options = [{ id: '0', name: '' }]
product_import_dates_query.collect(&:import_date).
map { |i| options.push(id: i.to_date, name: i.to_date.to_formatted_s(:long)) }
map { |i| options.push(id: i.to_date, name: i.to_date.to_fs(:long)) }
options
end

View File

@@ -233,7 +233,7 @@ describe "Product Import" do
end
expect(page).to have_selector 'div#s2id_import_date_filter'
import_time = carrots.import_date.to_date.to_formatted_s(:long).gsub(' ', ' ')
import_time = carrots.import_date.to_date.to_fs(:long).gsub(' ', ' ')
select2_select import_time, from: "import_date_filter"
page.find('.button.icon-search').click