Correct Style/SlicingWithRange rubocop offenses

This commit is contained in:
Carlos Chitty
2025-03-26 11:10:58 -04:00
parent 58a16d89a3
commit ecb303fef5
4 changed files with 3 additions and 11 deletions

View File

@@ -677,11 +677,3 @@ Style/ReturnNilInPredicateMethodDefinition:
- 'app/models/order_cycle.rb'
- 'app/serializers/api/admin/customer_serializer.rb'
- 'engines/order_management/app/services/order_management/subscriptions/validator.rb'
# Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/SlicingWithRange:
Exclude:
- 'app/helpers/spree/admin/navigation_helper.rb'
- 'app/services/embedded_page_service.rb'
- 'engines/order_management/app/services/order_management/subscriptions/validator.rb'

View File

@@ -122,7 +122,7 @@ module Spree
end
else
if html_options['data-update'].nil? && html_options[:remote]
object_name, action = url.split('/')[-2..-1]
object_name, action = url.split('/')[-2..]
html_options['data-update'] = [action, object_name.singularize].join('_')
end

View File

@@ -81,7 +81,7 @@ class EmbeddedPageService
def current_referer_without_www
return unless current_referer
current_referer.start_with?('www.') ? current_referer[4..-1] : current_referer
current_referer.start_with?('www.') ? current_referer[4..] : current_referer
end
def set_embedded_layout

View File

@@ -128,7 +128,7 @@ module OrderManagement
end
def build_msg_from(key, msg)
return msg[1..-1] if msg.starts_with?("^")
return msg[1..] if msg.starts_with?("^")
errors.full_message(key, msg)
end