tiny_builder 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/tiny_builder/quantity_builder.rb +13 -1
- data/lib/tiny_builder/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 710269f8d83787a9a2e6ff92fd7b9337592fea49d5019d2f1f53ebc8d518efd8
|
|
4
|
+
data.tar.gz: 847744366873416b97b78fc6b8759db96725a5dbbc2020509997924bf7a778ab
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bd5c11a3f65e5964bb33446d8b7599a76290b2b5d2cbd975f02647b6bff46adb466177c5646f7621c905ed7c31eed4dede6d799c54e42696f35a877f889c18c0
|
|
7
|
+
data.tar.gz: a51e9edde40054cafbded563b28c4047f535351c8dc140f5d997498d7e4ecb3d6dd91cd8a1c62ad95a20d5fc573414c3f9ff59166587c362aa11e684adf4a63b
|
|
@@ -12,7 +12,7 @@ class TinyBuilder
|
|
|
12
12
|
if channel_id == 2
|
|
13
13
|
{
|
|
14
14
|
inventory_item_id: listing[:inventory_item_id],
|
|
15
|
-
location_id: listing
|
|
15
|
+
location_id: shopify_location_id(listing)
|
|
16
16
|
}
|
|
17
17
|
elsif channel_id == 19
|
|
18
18
|
{
|
|
@@ -22,5 +22,17 @@ class TinyBuilder
|
|
|
22
22
|
{}
|
|
23
23
|
end
|
|
24
24
|
end
|
|
25
|
+
|
|
26
|
+
# Single-warehouse stock is counted from the mapped Forstok warehouse
|
|
27
|
+
# (see QuantityHelper#single_warehouse_space), so push it to that same
|
|
28
|
+
# mapping's Shopify location. The location saved on the listing is only
|
|
29
|
+
# a fallback, because it can point to any Shopify location (FORSTOK-10682).
|
|
30
|
+
def shopify_location_id(listing)
|
|
31
|
+
return listing[:location_id] if mwh
|
|
32
|
+
|
|
33
|
+
mapped = warehouse_mapping && warehouse_mapping[:channel_warehouse_id]
|
|
34
|
+
mapped = mapped.to_s.strip
|
|
35
|
+
mapped.match?(/\A\d+\z/) ? mapped.to_i : listing[:location_id]
|
|
36
|
+
end
|
|
25
37
|
end
|
|
26
38
|
end
|
data/lib/tiny_builder/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tiny_builder
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- hayakaza
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-11-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -169,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
169
169
|
- !ruby/object:Gem::Version
|
|
170
170
|
version: '0'
|
|
171
171
|
requirements: []
|
|
172
|
-
rubygems_version: 3.
|
|
172
|
+
rubygems_version: 3.4.19
|
|
173
173
|
signing_key:
|
|
174
174
|
specification_version: 4
|
|
175
175
|
summary: Simple item builder for Forstok
|