From 014283447d3ef198ef4d59025ee5977688ce46ae Mon Sep 17 00:00:00 2001 From: Rob Harrington Date: Fri, 23 Feb 2018 15:45:57 +1100 Subject: [PATCH] Use delegate to access subscription shop --- app/services/subscription_estimator.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/services/subscription_estimator.rb b/app/services/subscription_estimator.rb index 81ef1a3f68..6de522b15f 100644 --- a/app/services/subscription_estimator.rb +++ b/app/services/subscription_estimator.rb @@ -11,7 +11,7 @@ class SubscriptionEstimator attr_accessor :subscription - delegate :subscription_line_items, to: :subscription + delegate :subscription_line_items, :shop, to: :subscription def assign_price_estimates subscription_line_items.each do |item| @@ -29,12 +29,12 @@ class SubscriptionEstimator def fee_calculator return @fee_calculator unless @fee_calculator.nil? - shop, next_oc = subscription.shop, subscription.schedule.andand.current_or_next_order_cycle + next_oc = subscription.schedule.andand.current_or_next_order_cycle return nil unless shop && next_oc @fee_calculator = OpenFoodNetwork::EnterpriseFeeCalculator.new(shop, next_oc) end def scoper - OpenFoodNetwork::ScopeVariantToHub.new(subscription.shop) + OpenFoodNetwork::ScopeVariantToHub.new(shop) end end