From 33409725a5f6fdabf0255968cd745360f8e1dc74 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Fri, 14 Apr 2023 16:15:13 +1000 Subject: [PATCH] Run rubocop-rails with current Rails version 7.0 This adds three new issues I will address in the next commits. ``` Offenses: app/json_schemas/json_api_schema.rb:40:7: C: [Correctable] Rails/IndexWith: Prefer index_with over to_h { ... }. relationships.to_h { |name| [name, relationship_schema(name)] } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lib/reporting/reports/enterprise_fee_summary/base.rb:18:11: C: [Correctable] Rails/IndexWith: Prefer index_with over map { ... }.to_h. data_attributes.map { |attr| [attr, I18n.t("header.#{attr}", scope: i18n_scope)] }.to_h ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lib/reporting/reports/sales_tax/sales_tax_totals_by_order.rb:140:14: C: [Correctable] Rails/Pick: Prefer pick('sum(amount)') over pluck('sum(amount)').first. .pluck('sum(amount)').first || 0 ^^^^^^^^^^^^^^^^^^^^^^^^^^ 1404 files inspected, 3 offenses detected, 3 offenses autocorrectable ``` --- .rubocop_styleguide.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.rubocop_styleguide.yml b/.rubocop_styleguide.yml index 15f52ac883..b9316a39c8 100644 --- a/.rubocop_styleguide.yml +++ b/.rubocop_styleguide.yml @@ -4,7 +4,6 @@ AllCops: NewCops: disable SuggestExtensions: false - TargetRailsVersion: 5.0 Exclude: - 'bin/**/*' - 'db/**/*'