summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandrea longhi <andrea@spaghetticode.it>2020-01-22 10:25:58 +0100
committerandrea longhi <andrea@spaghetticode.it>2020-01-22 10:32:06 +0100
commitac30ff69f619bc504cd295de2f983310077b30e0 (patch)
tree3edcb7b3fedbdc699b2d68079ecbb7e506dc8f66
parentc28df097c661387e3e37d06eb56380fb59f58754 (diff)
Remove unnecessay safe navigator
The safe navigator is not necessary here, as all other method calls on `address` don't have it.
-rw-r--r--CHANGELOG.md1
-rw-r--r--lib/super_good/solidus_taxjar/calculator_helper.rb2
2 files changed, 2 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 581f0d8..4e56853 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,7 @@
# Changelog
## master
+- Fix `#incomplete_address?` method to be friendly also to completely blank addresses.
- Added `SuperGood::SolidusTaxJar::TaxRateCalculator` for retrieving the tax rate for a given `Spree::Address`. The calculator follows `TaxCalculator` conventions by relying on address validators and custom exception handling.
diff --git a/lib/super_good/solidus_taxjar/calculator_helper.rb b/lib/super_good/solidus_taxjar/calculator_helper.rb
index 636f322..dbde950 100644
--- a/lib/super_good/solidus_taxjar/calculator_helper.rb
+++ b/lib/super_good/solidus_taxjar/calculator_helper.rb
@@ -15,7 +15,7 @@ module SuperGood
[
address.address1,
address.city,
- address&.state&.abbr || address.state_name,
+ address.state&.abbr || address.state_name,
address.zipcode,
address.country&.iso
].any?(&:blank?)