From 3135ef6b7fa9ab38e441b4cfa58872b51da0c53b Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Wed, 9 Nov 2016 12:47:57 +1100 Subject: [PATCH] Reinstate explicit class name Spree::Calculator on calculated_adjustments association --- .../core/calculated_adjustments_decorator.rb | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/spree/core/calculated_adjustments_decorator.rb b/lib/spree/core/calculated_adjustments_decorator.rb index 6b12b4a64d..592bf59854 100644 --- a/lib/spree/core/calculated_adjustments_decorator.rb +++ b/lib/spree/core/calculated_adjustments_decorator.rb @@ -1,16 +1,16 @@ -# Maybe we don't need this any more? Commenting out during upgrade process +module Spree + module Core + module CalculatedAdjustments + class << self + def included_with_explicit_class_name(klass) + included_without_explicit_class_name(klass) -# module Spree -# module Core -# module CalculatedAdjustments -# module ClassMethods -# def calculated_adjustments_with_explicit_class_name -# calculated_adjustments_without_explicit_class_name -# # Class name is mis-inferred outside of Spree namespace -# has_one :calculator, as: :calculable, dependent: :destroy, class_name: 'Spree::Calculator' -# end -# alias_method_chain :calculated_adjustments, :explicit_class_name -# end -# end -# end -# end + klass.class_eval do + has_one :calculator, as: :calculable, dependent: :destroy, class_name: 'Spree::Calculator' + end + end + alias_method_chain :included, :explicit_class_name + end + end + end +end