valken-shipping 2.0.3 → 2.0.4

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: f9818be8a62cad5c315d34ab0f92ad3329e92cc783239a7e79eb2d0a1ef57ed6
4
- data.tar.gz: b4ce33dbb4c6521fd0bba0aa7be81d14141bd44d6f9e98ab3b05580b418c8027
3
+ metadata.gz: de87f21281f76ad4ff9f00e829c028e2e1ba1f4813c821d89664f11024725171
4
+ data.tar.gz: 98658fd8e5aef01ad8f763751cb577ee5ca2fd94818605926a49713dce77be23
5
5
  SHA512:
6
- metadata.gz: aefdbcffb8b51ff670231ad598a339fb4f8184f3670252d0d982136c5b13c834a913dd8db3b581b72bf89b9e393c1f77411e4e805b149042dd4ed72048453652
7
- data.tar.gz: 676daa8bcf724b0c134e66bfc95ace4fa8be4ad3745c422badfd794c8ff64bae749e48ed87664a2896a54f00f52b33f3c8fb659f6aa2e804530a198befc3689c
6
+ metadata.gz: 7c6dd426e9a1631da60b4c1acd121ac0ace51837c7e94c5bf06e18a8698c7a8b0cdbc113c7f28962cd8b65f9922e388fc5ff3db6a17f4e49fd31c325bf8ce0ed
7
+ data.tar.gz: 6c7fa9cd69747eb934f40231ebc829aea8a0c0d60705c5bb172f9d5296bc3ede35a2c2c490a3a88adf6853de0edb5957f537b968c7d12ede5c6f8ec0f9288c9b
@@ -19,13 +19,16 @@ module Workarea
19
19
  end
20
20
 
21
21
  def is_usa_only?
22
-
22
+
23
23
  orders = current_order rescue nil
24
24
  return false if orders.blank? || orders.items.blank?
25
25
 
26
26
  usa_only_attribute = Workarea.config.shipping_attributes[:usa_only]
27
- product_attributes = orders.items.map(&:product_attributes)
28
- return product_attributes.map{ |item| item[:details][:en][usa_only_attribute] }.flatten.include?("true")
27
+ return product_details(orders).map{ |item| item[:en][usa_only_attribute] }.flatten.include?("true")
28
+ end
29
+
30
+ def product_details(orders)
31
+ @product_details ||= Catalog::Product.in(id: orders.items.to_a.map(&:product_id)).pluck(:details)
29
32
  end
30
33
 
31
34
  def formatted_address(address)
@@ -1,5 +1,5 @@
1
1
  module Valken
2
2
  module Shipping
3
- VERSION = '2.0.3'
3
+ VERSION = '2.0.4'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: valken-shipping
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - sushmitha02
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-07 00:00:00.000000000 Z
11
+ date: 2020-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails