effective_addresses 1.9.2 → 1.9.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e41141e340c412a2e083dfb79792a86f102484fe61734eebf85963ba17c287c8
|
4
|
+
data.tar.gz: f0f60629f50f7f20e3e8ba6976e6ba9554b18ed6bb38870a4653ab1ad33b9c17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 934bf8000a28eb370e5f444d6f70610ea7b63f5c0d71c0e1da9f1ed0d83265b697b424489b732d2469e3a23edde57c603d11b2daf2aec9a4688635239e45ee4d
|
7
|
+
data.tar.gz: 170e98c482c1d99e3907864773762f487f0b61b0e5fc8399ffcac6c11f4d03655b547450d0c7a8ae856b97a7b13469bbe83f7a602ad8304b9ae32397f9f82179
|
@@ -37,7 +37,7 @@ module EffectiveAddressesHelper
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
-
def effective_address_regions_collection(regions = nil)
|
40
|
+
def effective_address_regions_collection(regions = nil, resource: nil)
|
41
41
|
if regions.present?
|
42
42
|
countries = regions
|
43
43
|
elsif EffectiveAddresses.country_codes == :all
|
@@ -61,7 +61,15 @@ module EffectiveAddressesHelper
|
|
61
61
|
)
|
62
62
|
end
|
63
63
|
|
64
|
+
# Special behaviour if the address has CAN, we treat it as CA
|
65
|
+
if regions.blank? && resource.present? && resource.country_code == 'CAN'
|
66
|
+
ca = countries.index { |_, code| code == 'CA' }
|
67
|
+
|
68
|
+
if ca.present?
|
69
|
+
countries[ca] = ['Canada', 'CAN']
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
64
73
|
countries
|
65
74
|
end
|
66
75
|
end
|
67
|
-
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_addresses
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.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:
|
11
|
+
date: 2021-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|