From 1b167080f469f36a76512dd3fb45389e1b2578f3 Mon Sep 17 00:00:00 2001 From: Jared Norman Date: Sun, 24 Mar 2019 11:49:16 -0700 Subject: Remove cache key hack This never actually worked as expected. While imperfect, use the order params directly will produce better results. --- CHANGELOG.md | 2 ++ lib/super_good/solidus_taxjar.rb | 10 +--------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47b07aa..4dca499 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## master +- Fixed unreliable default cache key implementation. + ## v0.9.0 - Made response cache key and cache duration configurable. diff --git a/lib/super_good/solidus_taxjar.rb b/lib/super_good/solidus_taxjar.rb index ba4ff48..4e7d9c5 100644 --- a/lib/super_good/solidus_taxjar.rb +++ b/lib/super_good/solidus_taxjar.rb @@ -22,15 +22,7 @@ module SuperGood end self.cache_duration = 3.hours - self.cache_key = ->(order) { - APIParams.order_params(order).transform_values do |value| - case value - when Array, Hash then value.hash - else - value - end - end - } + self.cache_key = ->(order) { APIParams.order_params(order) } self.discount_calculator = ::SuperGood::SolidusTaxJar::DiscountCalculator self.exception_handler = ->(e) { Rails.logger.error "An error occurred while fetching TaxJar tax rates - #{e}: #{e.message}" -- cgit v1.2.3 From d44c5ead793c8276aee7603a26f535d214ab4e69 Mon Sep 17 00:00:00 2001 From: Jared Norman Date: Sun, 24 Mar 2019 11:50:46 -0700 Subject: Bump to v0.9.1 --- CHANGELOG.md | 2 ++ lib/super_good/solidus_taxjar/version.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4dca499..c942fb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## master +## v0.9.1 + - Fixed unreliable default cache key implementation. ## v0.9.0 diff --git a/lib/super_good/solidus_taxjar/version.rb b/lib/super_good/solidus_taxjar/version.rb index bd3ad9c..5cd9e64 100644 --- a/lib/super_good/solidus_taxjar/version.rb +++ b/lib/super_good/solidus_taxjar/version.rb @@ -1,5 +1,5 @@ module SuperGood module SolidusTaxJar - VERSION = "0.9.0" + VERSION = "0.9.1" end end -- cgit v1.2.3