diff --git a/app/models/order_updater.rb b/app/models/order_updater.rb index e8514a1b75..95d2b96cfb 100644 --- a/app/models/order_updater.rb +++ b/app/models/order_updater.rb @@ -27,7 +27,7 @@ class OrderUpdater < SimpleDelegator def shipping_address_from_distributor return if order.shipping_method.blank? || order.shipping_method.require_ship_address - order.ship_address = order.__send__(:address_from_distributor) + order.ship_address = order.address_from_distributor end private diff --git a/app/models/spree/order_decorator.rb b/app/models/spree/order_decorator.rb index 076c00e0f6..ae95add49f 100644 --- a/app/models/spree/order_decorator.rb +++ b/app/models/spree/order_decorator.rb @@ -326,12 +326,6 @@ Spree::Order.class_eval do total.to_f > 0.0 && !skip_payment_for_subscription? end - private - - def skip_payment_for_subscription? - subscription.present? && order_cycle.orders_close_at.andand > Time.zone.now - end - def address_from_distributor address = distributor.address.clone if bill_address @@ -342,6 +336,12 @@ Spree::Order.class_eval do address end + private + + def skip_payment_for_subscription? + subscription.present? && order_cycle.orders_close_at.andand > Time.zone.now + end + def provided_by_order_cycle?(line_item) order_cycle_variants = order_cycle.andand.variants || [] order_cycle_variants.include? line_item.variant diff --git a/app/services/order_syncer.rb b/app/services/order_syncer.rb index 513df73dc7..b3e37c0ea4 100644 --- a/app/services/order_syncer.rb +++ b/app/services/order_syncer.rb @@ -107,7 +107,7 @@ class OrderSyncer # address on the order matches the shop's address def force_ship_address_required?(order) return false unless shipping_method.require_ship_address? - distributor_address = order.__send__(:address_from_distributor) + distributor_address = order.address_from_distributor relevant_address_attrs.all? do |attr| order.ship_address[attr] == distributor_address[attr] end