valken-shipping 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/services/workarea/packaging.decorator +15 -1
- data/lib/valken/shipping/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6737dc3d986324920e209163dbbd483d3c71326f1e648fb1aabce037532951e
|
4
|
+
data.tar.gz: 61ee46bf6044bc76d3151c4ed82881bc52c239a5852482970057838ef2efef91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '05008742de8bd382a1f74d139941db9e2e865f7f7aee9f3b106e80f51c83f672a61d788cbe95d6239be6e49d9ee87534f7e138ebaf30138e79abd25909a14882'
|
7
|
+
data.tar.gz: 77a5fd5041ba0f282bf5a45897eb410fd5b56cbcc6b813495fb0e965c2413d6972687774d98bbbfe32ed0bab62ec10de3ac2d3b37ba83097bd4ffcdda80e8f03
|
@@ -10,7 +10,21 @@ module Workarea
|
|
10
10
|
def find_sku_weight(sku)
|
11
11
|
sku_data = Catalog::Product.find_by_sku(sku).variants
|
12
12
|
sku = sku_data.detect {|variant| variant.sku == sku }
|
13
|
-
sku
|
13
|
+
if is_pounds(sku)
|
14
|
+
convert_to_lb(sku.weight)
|
15
|
+
else
|
16
|
+
sku.weight || 0
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def convert_to_lb(weight)
|
21
|
+
unit = Measured::Weight.new(weight, :lb)
|
22
|
+
unit.convert_to(:oz)
|
23
|
+
unit.value
|
24
|
+
end
|
25
|
+
|
26
|
+
def is_pounds(sku)
|
27
|
+
sku.weight_unit == "lb"
|
14
28
|
end
|
15
29
|
end
|
16
30
|
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: 0.1.
|
4
|
+
version: 0.1.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-
|
11
|
+
date: 2020-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|