From daab65e60da1bc0ca71eab92c48d5e2a0a04e84f Mon Sep 17 00:00:00 2001 From: agnieszkajacek Date: Fri, 17 Dec 2021 14:29:44 +0100 Subject: [PATCH 1/4] Do not fire code twice --- .../spree/return_authorization_decorator.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/spree_avatax_official/spree/return_authorization_decorator.rb b/app/models/spree_avatax_official/spree/return_authorization_decorator.rb index 8e3abbb7..b913ba22 100644 --- a/app/models/spree_avatax_official/spree/return_authorization_decorator.rb +++ b/app/models/spree_avatax_official/spree/return_authorization_decorator.rb @@ -20,4 +20,6 @@ def refund_in_avatax end end -::Spree::ReturnAuthorization.prepend(::SpreeAvataxOfficial::Spree::ReturnAuthorizationDecorator) unless 'Spree::Refund'.safe_constantize +unless ::Spree::ReturnAuthorization.ancestors.include?(::SpreeAvataxOfficial::Spree::ReturnAuthorizationDecorator) + ::Spree::ReturnAuthorization.prepend(::SpreeAvataxOfficial::Spree::ReturnAuthorizationDecorator) unless 'Spree::Refund'.safe_constantize +end From b0a7be9a1c6edd028ed18d151dfb9ab8b9329cdd Mon Sep 17 00:00:00 2001 From: agnieszkajacek Date: Fri, 17 Dec 2021 16:52:32 +0100 Subject: [PATCH 2/4] Fix failing tests --- app/models/spree_avatax_official/spree/order_decorator.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/models/spree_avatax_official/spree/order_decorator.rb b/app/models/spree_avatax_official/spree/order_decorator.rb index 0c15947d..3764f33f 100644 --- a/app/models/spree_avatax_official/spree/order_decorator.rb +++ b/app/models/spree_avatax_official/spree/order_decorator.rb @@ -88,4 +88,7 @@ def void_in_avatax end end -::Spree::Order.prepend ::SpreeAvataxOfficial::Spree::OrderDecorator +unless ::Spree::Order.ancestors.include?(::SpreeAvataxOfficial::Spree::OrderDecorator) + ::Spree::Order.prepend(::SpreeAvataxOfficial::Spree::OrderDecorator) +end + From e46b85261d950b457c46d43343fabe5af7f9843c Mon Sep 17 00:00:00 2001 From: agnieszkajacek Date: Mon, 10 Jan 2022 15:19:10 +0100 Subject: [PATCH 3/4] Rubocop fix --- app/models/spree_avatax_official/spree/order_decorator.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/models/spree_avatax_official/spree/order_decorator.rb b/app/models/spree_avatax_official/spree/order_decorator.rb index 3764f33f..d0afd971 100644 --- a/app/models/spree_avatax_official/spree/order_decorator.rb +++ b/app/models/spree_avatax_official/spree/order_decorator.rb @@ -91,4 +91,3 @@ def void_in_avatax unless ::Spree::Order.ancestors.include?(::SpreeAvataxOfficial::Spree::OrderDecorator) ::Spree::Order.prepend(::SpreeAvataxOfficial::Spree::OrderDecorator) end - From b866f3c8cdcf43af3a19edbad2235a56d9b79686 Mon Sep 17 00:00:00 2001 From: Geoff Longman Date: Thu, 3 Nov 2022 16:00:08 -0400 Subject: [PATCH 4/4] alter gemspec dependency on avatax gem to match master (#176) related FS iss.ue 28352 --- spree_avatax_official.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spree_avatax_official.gemspec b/spree_avatax_official.gemspec index 10aa1aff..0786249b 100644 --- a/spree_avatax_official.gemspec +++ b/spree_avatax_official.gemspec @@ -20,7 +20,7 @@ Gem::Specification.new do |s| # rubocop:disable Metrics/BlockLength s.require_path = 'lib' s.requirements << 'none' - s.add_dependency 'avatax', '~> 19.3' + s.add_dependency 'avatax', '>= 19.3' spree_version = '>= 2.1.0'