effective_orders 5.1.2 → 5.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e62ea845d2b3982fbb11f3f6c50c7e225ad96d928a7ba957a19b7e3b997eb1d8
4
- data.tar.gz: 49350bba4a80a42aca9e0d81d9fd1140fdace45b57db00ea951fd61ca3234b08
3
+ metadata.gz: ade00cb763bc7fbe35b7328f3b3b5950eda644ad3db27a62106b96676ec9a057
4
+ data.tar.gz: da28c05225df93566ac1633ee0ab681ead8e1c3642bf90f85a27c291c52c4a5d
5
5
  SHA512:
6
- metadata.gz: 434791b34029447935fe2ebd8d1520ecb4abd59d9d31fcb11f08ed3b8db3c07841b46cb75d4f40fd36072a636f84a1a4b524b08565b5cbe4155ba39f8bf40553
7
- data.tar.gz: 4a2e1df8a24b1cadf8bb845655de1e1b2adba896c6b74b52fda7fcb4d2ef80302958bbbd6b72221b88738b9f8c595279daefb9381244c6fa09df81df812b4838
6
+ metadata.gz: 1217f8ca75c06b59a787f5ddc9f83e65331e904f2a492a01d5b16dca4917c470e5c527fbbd9cc97f3dd05263904b1dc7e87aa3afe11db25e535d65fe31de7287
7
+ data.tar.gz: 492aa5d8c2a6b1ea7611d0f29f5edc3b09b53bcca717405acb7e9310e1f3966d71ee29680d51340def9e168855a164340a754a4b8259c333c510fab87b21e974
@@ -225,7 +225,6 @@ module Effective
225
225
  retval.size == 1 ? retval.first : retval
226
226
  end
227
227
 
228
-
229
228
  def update_prices!
230
229
  raise('already purchased') if purchased?
231
230
  raise('must be pending or confirmed') unless pending? || confirmed?
@@ -30,8 +30,13 @@ module Effective
30
30
  end
31
31
 
32
32
  def tax_rate
33
- country = country_code || (order.billing_address.country_code if order.billing_address.present?)
34
- state = state_code || (order.billing_address.state_code if order.billing_address.present?)
33
+ country = country_code
34
+ country ||= order.billing_address.country_code if order.billing_address.present?
35
+ country ||= order.user.billing_address.country_code if order.user.respond_to?(:billing_address) && order.user.billing_address.present?
36
+
37
+ state = state_code
38
+ state ||= order.billing_address.state_code if order.billing_address.present?
39
+ state ||= order.user.billing_address.state_code if order.user.respond_to?(:billing_address) && order.user.billing_address.present?
35
40
 
36
41
  rate = RATES[country]
37
42
  return rate if rate.kind_of?(Numeric)
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '5.1.2'.freeze
2
+ VERSION = '5.1.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_orders
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.2
4
+ version: 5.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-28 00:00:00.000000000 Z
11
+ date: 2021-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails