From ba693e3ecfc8eff46ea8156436bea8420ffa5364 Mon Sep 17 00:00:00 2001 From: Carlos Chitty Date: Tue, 25 Mar 2025 13:21:58 -0400 Subject: [PATCH 1/2] Autocorrect rubocop offense Style/RedundantAssignment --- .rubocop_todo.yml | 6 ------ spec/models/database_spec.rb | 4 +--- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 6872fe13ea..2cb5fc47d3 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -709,12 +709,6 @@ Style/RedundantArgument: Exclude: - 'engines/dfc_provider/app/services/authorization_control.rb' -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Style/RedundantAssignment: - Exclude: - - 'spec/models/database_spec.rb' - # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: AutoCorrect, AllowComments. diff --git a/spec/models/database_spec.rb b/spec/models/database_spec.rb index 609f275646..2994085c97 100644 --- a/spec/models/database_spec.rb +++ b/spec/models/database_spec.rb @@ -102,7 +102,7 @@ RSpec.describe "Database" do orphaned_records_query = generate_orphaned_records_query(model_class, foreign_key_table_name, foreign_key_column) - migration = <<~MIGRATION + <<~MIGRATION # Orphaned records can be found before running this migration with the following SQL: #{orphaned_records_query} @@ -113,8 +113,6 @@ RSpec.describe "Database" do end end MIGRATION - - migration end def generate_orphaned_records_query(model_class, foreign_key_table_name, foreign_key_column) From dca2714aa7a549b3e6c23df4330891707494040c Mon Sep 17 00:00:00 2001 From: Carlos Chitty Date: Tue, 25 Mar 2025 13:35:56 -0400 Subject: [PATCH 2/2] Autocorrect rubocop offense Style/RedundantArgument --- .rubocop_todo.yml | 7 ------- engines/dfc_provider/app/services/authorization_control.rb | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 2cb5fc47d3..b35c85e16a 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -702,13 +702,6 @@ Style/PreferredHashMethods: Exclude: - 'app/controllers/api/v0/shipments_controller.rb' -# Offense count: 1 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: Methods. -Style/RedundantArgument: - Exclude: - - 'engines/dfc_provider/app/services/authorization_control.rb' - # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: AutoCorrect, AllowComments. diff --git a/engines/dfc_provider/app/services/authorization_control.rb b/engines/dfc_provider/app/services/authorization_control.rb index 879eab7980..a68db2dc6e 100644 --- a/engines/dfc_provider/app/services/authorization_control.rb +++ b/engines/dfc_provider/app/services/authorization_control.rb @@ -47,7 +47,7 @@ class AuthorizationControl end def access_token - @request.headers['Authorization'].to_s.split(' ').last + @request.headers['Authorization'].to_s.split.last end def ofn_api_token