mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-04 22:16:08 +00:00
Correct Style/SlicingWithRange rubocop offenses
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user