From da1e1a98595e597b57ce0222526eba0b1650604f Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 18 Feb 2026 09:42:07 +1100 Subject: [PATCH] Style indentation --- app/models/spree/product.rb | 2 +- app/models/spree/taxon.rb | 4 ++-- app/models/spree/variant.rb | 12 ++++++------ app/services/dfc_catalog_importer.rb | 8 ++++---- app/services/line_item_syncer.rb | 4 ++-- lib/reporting/reports/customers/base.rb | 8 ++++---- .../enterprise_fees_with_tax_report_by_order.rb | 10 +++++----- spec/models/spree/order/state_machine_spec.rb | 10 +++++----- spec/models/spree/user_spec.rb | 2 +- spec/services/orders/compare_invoice_service_spec.rb | 4 ++-- spec/system/admin/bulk_order_management_spec.rb | 8 ++++---- spec/system/consumer/checkout/payment_spec.rb | 6 +++--- 12 files changed, 39 insertions(+), 39 deletions(-) diff --git a/app/models/spree/product.rb b/app/models/spree/product.rb index 2ad3561b6c..e077af407b 100755 --- a/app/models/spree/product.rb +++ b/app/models/spree/product.rb @@ -251,7 +251,7 @@ module Spree transaction do ExchangeVariant. where(exchange_variants: { variant_id: variants.with_deleted. - select(:id) }).destroy_all + select(:id) }).destroy_all yield end diff --git a/app/models/spree/taxon.rb b/app/models/spree/taxon.rb index 09c772fdf0..a663a05922 100644 --- a/app/models/spree/taxon.rb +++ b/app/models/spree/taxon.rb @@ -35,8 +35,8 @@ module Spree taxons .pluck('spree_taxons.id, enterprises.id AS enterprise_id') .each_with_object({}) do |(taxon_id, enterprise_id), collection| - collection[enterprise_id.to_i] ||= Set.new - collection[enterprise_id.to_i] << taxon_id + collection[enterprise_id.to_i] ||= Set.new + collection[enterprise_id.to_i] << taxon_id end end diff --git a/app/models/spree/variant.rb b/app/models/spree/variant.rb index 63baad819e..d6eda45ca8 100644 --- a/app/models/spree/variant.rb +++ b/app/models/spree/variant.rb @@ -167,8 +167,8 @@ module Spree # In Rails 3, merging two scopes on the same column will consider only the last scope. def self.in_distributor(distributor) where(id: ExchangeVariant.select(:variant_id). - joins(:exchange). - where('exchanges.incoming = ? AND exchanges.receiver_id = ?', false, distributor)) + joins(:exchange). + where('exchanges.incoming = ? AND exchanges.receiver_id = ?', false, distributor)) end def self.indexed @@ -179,11 +179,11 @@ module Spree # "where(id:" is necessary so that the returned relation has no includes # The relation without includes will not be readonly and allow updates on it where(spree_variants: { id: joins(:prices). - where(deleted_at: nil). - where('spree_prices.currency' => + where(deleted_at: nil). + where('spree_prices.currency' => currency || CurrentConfig.get(:currency)). - where.not(spree_prices: { amount: nil }). - select("spree_variants.id") }) + where.not(spree_prices: { amount: nil }). + select("spree_variants.id") }) end def self.linked_to(semantic_id) diff --git a/app/services/dfc_catalog_importer.rb b/app/services/dfc_catalog_importer.rb index 16d81ac6d3..8ec1c74310 100644 --- a/app/services/dfc_catalog_importer.rb +++ b/app/services/dfc_catalog_importer.rb @@ -42,10 +42,10 @@ class DfcCatalogImporter .includes(:semantic_links).references(:semantic_links) .where.not(semantic_links: { semantic_id: present_ids }) .select do |variant| - # Variants that were in the same catalog before: - variant.semantic_links.map(&:semantic_id).any? do |semantic_id| - FdcUrlBuilder.new(semantic_id).catalog_url == catalog_url - end + # Variants that were in the same catalog before: + variant.semantic_links.map(&:semantic_id).any? do |semantic_id| + FdcUrlBuilder.new(semantic_id).catalog_url == catalog_url + end end end end diff --git a/app/services/line_item_syncer.rb b/app/services/line_item_syncer.rb index fb2af07b13..ce7fda37eb 100644 --- a/app/services/line_item_syncer.rb +++ b/app/services/line_item_syncer.rb @@ -51,8 +51,8 @@ class LineItemSyncer def destroy_obsolete_items(order) order.line_items. where(variant_id: subscription_line_items. - select(&:marked_for_destruction?). - map(&:variant_id)). + select(&:marked_for_destruction?). + map(&:variant_id)). destroy_all end diff --git a/lib/reporting/reports/customers/base.rb b/lib/reporting/reports/customers/base.rb index b53fb7b44c..3539775c6d 100644 --- a/lib/reporting/reports/customers/base.rb +++ b/lib/reporting/reports/customers/base.rb @@ -10,10 +10,10 @@ module Reporting .complete.not_state(:canceled) .order(:id)) .group_by do |order| - { - customer_id: order.customer_id || order.email, - hub_id: order.distributor_id, - } + { + customer_id: order.customer_id || order.email, + hub_id: order.distributor_id, + } end.values end diff --git a/lib/reporting/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_order.rb b/lib/reporting/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_order.rb index abc27aa844..51c6a21fe5 100644 --- a/lib/reporting/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_order.rb +++ b/lib/reporting/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_order.rb @@ -44,11 +44,11 @@ module Reporting .filter(&method(:filter_enterprise_fee_by_id)) .filter(&method(:filter_enterprise_fee_by_owner)) .map do |enterprise_fee_id, enterprise_fee_adjustment_ids| - { - enterprise_fee_id:, - enterprise_fee_adjustment_ids:, - order: - } + { + enterprise_fee_id:, + enterprise_fee_adjustment_ids:, + order: + } end end end diff --git a/spec/models/spree/order/state_machine_spec.rb b/spec/models/spree/order/state_machine_spec.rb index 7ac1d81333..f50326789d 100644 --- a/spec/models/spree/order/state_machine_spec.rb +++ b/spec/models/spree/order/state_machine_spec.rb @@ -86,11 +86,11 @@ RSpec.describe Spree::Order do (Spree::Shipment.state_machine.states.keys - [:pending, :backorder, :ready]) .each do |shipment_state| - it "should be false if shipment_state is #{shipment_state}" do - allow(order).to receive_messages completed?: true - order.shipment_state = shipment_state - expect(order.can_cancel?).to be_falsy - end + it "should be false if shipment_state is #{shipment_state}" do + allow(order).to receive_messages completed?: true + order.shipment_state = shipment_state + expect(order.can_cancel?).to be_falsy + end end end diff --git a/spec/models/spree/user_spec.rb b/spec/models/spree/user_spec.rb index 517b405ac7..5e6fea55ef 100644 --- a/spec/models/spree/user_spec.rb +++ b/spec/models/spree/user_spec.rb @@ -17,7 +17,7 @@ RSpec.describe Spree::User do bill_address_attributes: new_bill_address.dup.attributes.merge( 'id' => old_bill_address.id ) - .except!('created_at', 'updated_at') + .except!('created_at', 'updated_at') ) expect(user.bill_address.id).to eq old_bill_address.id diff --git a/spec/services/orders/compare_invoice_service_spec.rb b/spec/services/orders/compare_invoice_service_spec.rb index 4580446b52..a3c5a8a2cc 100644 --- a/spec/services/orders/compare_invoice_service_spec.rb +++ b/spec/services/orders/compare_invoice_service_spec.rb @@ -38,8 +38,8 @@ RSpec.shared_examples "attribute changes - tax total changes" do |boolean, type, create(:order_with_taxes, product_price: 110, tax_rate_amount: 0.1, included_in_price: included_boolean) .tap do |order| - order.create_tax_charge! - order.update_shipping_fees! + order.create_tax_charge! + order.update_shipping_fees! end end diff --git a/spec/system/admin/bulk_order_management_spec.rb b/spec/system/admin/bulk_order_management_spec.rb index cf768670f2..33542ff71c 100644 --- a/spec/system/admin/bulk_order_management_spec.rb +++ b/spec/system/admin/bulk_order_management_spec.rb @@ -1044,10 +1044,10 @@ RSpec.describe ' page.driver .dismiss_modal :confirm, text: "Unsaved changes exist and will be lost if you continue." do - within "tr#li_#{li1.id}" do - fill_in "quantity", with: (li1.quantity + 1) - find("a.edit-order").click - end + within "tr#li_#{li1.id}" do + fill_in "quantity", with: (li1.quantity + 1) + find("a.edit-order").click + end end # So we save the changes diff --git a/spec/system/consumer/checkout/payment_spec.rb b/spec/system/consumer/checkout/payment_spec.rb index eac1eb1de0..4e513845b3 100644 --- a/spec/system/consumer/checkout/payment_spec.rb +++ b/spec/system/consumer/checkout/payment_spec.rb @@ -360,10 +360,10 @@ RSpec.describe "As a consumer, I want to checkout my order" do # And fake the payment status to avoid user interaction. allow_any_instance_of(Taler::Client) .to receive(:fetch_order) do - payment = Spree::Payment.last - url = payment_gateways_confirm_taler_path(payment_id: payment.id) + payment = Spree::Payment.last + url = payment_gateways_confirm_taler_path(payment_id: payment.id) - { "order_status_url" => url, "order_status" => "paid" } + { "order_status_url" => url, "order_status" => "paid" } end end