From bf5d948237ae9e48ba38666b58ce8baee477d0df Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 15 Apr 2024 05:15:32 -0400 Subject: [PATCH] Fix `Style/SingleArgumentDig` cop in webpacker/manifest_extensions (#29929) --- .rubocop_todo.yml | 5 ----- lib/webpacker/manifest_extensions.rb | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index ea1dbe57e..d7320aa9f 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -250,11 +250,6 @@ Style/SignalException: - 'lib/devise/strategies/two_factor_ldap_authenticatable.rb' - 'lib/devise/strategies/two_factor_pam_authenticatable.rb' -# This cop supports unsafe autocorrection (--autocorrect-all). -Style/SingleArgumentDig: - Exclude: - - 'lib/webpacker/manifest_extensions.rb' - # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Mode. Style/StringConcatenation: diff --git a/lib/webpacker/manifest_extensions.rb b/lib/webpacker/manifest_extensions.rb index 789eb81cc..8a184bc52 100644 --- a/lib/webpacker/manifest_extensions.rb +++ b/lib/webpacker/manifest_extensions.rb @@ -5,9 +5,9 @@ module Webpacker::ManifestExtensions asset = super if pack_type[:with_integrity] && asset.respond_to?(:dig) - [asset.dig('src'), asset.dig('integrity')] + [asset['src'], asset['integrity']] elsif asset.respond_to?(:dig) - asset.dig('src') + asset['src'] else asset end