summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJared Norman <jared@super.gd>2019-03-24 11:51:53 -0700
committerGitHub <noreply@github.com>2019-03-24 11:51:53 -0700
commit0cb3cb6ef633898d609c0cc43c5e48b2d0afd280 (patch)
tree96dc42d8f2f4ae8a034fedd97bfae48130de7e8a
parent981ee59475e4ba1257a5846f0773acac57b548fa (diff)
parentd44c5ead793c8276aee7603a26f535d214ab4e69 (diff)
Merge pull request #8 from SuperGoodSoft/caching-betterv0.9.1
Remove cache key hack
-rw-r--r--CHANGELOG.md4
-rw-r--r--lib/super_good/solidus_taxjar.rb10
-rw-r--r--lib/super_good/solidus_taxjar/version.rb2
3 files changed, 6 insertions, 10 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 47b07aa..c942fb1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,10 @@
## master
+## v0.9.1
+
+- 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}"
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