Skip to content

Commit

Permalink
Fix unsafe rubocop offenses
Browse files Browse the repository at this point in the history
Using

    rubocop -A

and verified they are safe.
  • Loading branch information
tvdeyen committed Feb 8, 2024
1 parent 00846b5 commit a0a2cb5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion api/app/views/spree/api/images/_image.json.jbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

json.(image, *image_attributes)
json.(image, :viewable_type, :viewable_id)
Spree::Image.attachment_definitions[:attachment][:styles].each do |key, _value|
Spree::Image.attachment_definitions[:attachment][:styles].each_key do |key|
json.set! "#{key}_url", image.url(key)
end
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def update
invoke_callbacks(:update, :before)

attributes = payment_method_params
attributes.each do |key, _value|
attributes.each_key do |key|
if key.include?("password") && attributes[key].blank?
attributes.delete(key)
end
Expand Down
4 changes: 2 additions & 2 deletions backend/app/controllers/spree/admin/products_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def location_after_save
if updating_variant_property_rules?
url_params = {}
url_params[:ovi] = []
params[:product][:variant_property_rules_attributes].each do |_index, param_attrs|
params[:product][:variant_property_rules_attributes].each_value do |param_attrs|
url_params[:ovi] += param_attrs[:option_value_ids]
end
spree.admin_product_product_properties_url(@product, url_params)
Expand Down Expand Up @@ -133,7 +133,7 @@ def render_after_update_error
def normalize_variant_property_rules
return unless updating_variant_property_rules?

params[:product][:variant_property_rules_attributes].each do |_index, param_attrs|
params[:product][:variant_property_rules_attributes].each_value do |param_attrs|
param_attrs[:option_value_ids] = param_attrs[:option_value_ids].split(',')
end
end
Expand Down
2 changes: 1 addition & 1 deletion core/app/models/spree/stock/splitter/shipping_category.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def split_by_category(package)

def hash_to_packages(categories)
packages = []
categories.each do |_id, contents|
categories.each_value do |contents|
packages << build_package(contents)
end
packages
Expand Down

0 comments on commit a0a2cb5

Please sign in to comment.