forest_liana 9.18.0 → 9.18.1
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0e8e72d0e55a7fcee31e0f8c292c459fa27cf16e761a762bf2b98bb3403d4de5
|
|
4
|
+
data.tar.gz: cb6b240fe4d578bd38f813e59bfbe09f55249c71425305193972eb242cd6d2ee
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f77c5a79408e893d6ea1e32dfa4cbcd940b5501c5982ce731598211f50d260a89f6344f35f1412905cb9061435dc41ae9e4d99cf20b86795a46f434f35cc0108
|
|
7
|
+
data.tar.gz: 945fa5c5c1144a49fb0916e6e322c1f67e9e4b44f9b9b731678afa19935a40c1c6694c161953314d2fd87ee40041b6308d1f947dcd8ff90313f506bb7da907e2
|
|
@@ -14,13 +14,18 @@ module ForestLiana
|
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
+
# Composite ids reach us in two shapes, both ordered like the model's primary_key:
|
|
18
|
+
# - JSON array "[v1,v2]" -> from the Forest frontend
|
|
19
|
+
# - pipe-joined "v1|v2" -> from the agent-client (workflow executor, Forest convention)
|
|
20
|
+
# Either way the values stay in primary_key order, so find_record can zip them directly.
|
|
17
21
|
def parse_composite_id(id)
|
|
18
22
|
return id if id.is_a?(Array)
|
|
19
23
|
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
str = id.to_s
|
|
25
|
+
if str.start_with?('[') && str.end_with?(']')
|
|
26
|
+
JSON.parse(str)
|
|
22
27
|
else
|
|
23
|
-
|
|
28
|
+
str.split('|')
|
|
24
29
|
end
|
|
25
30
|
end
|
|
26
31
|
end
|
data/lib/forest_liana/version.rb
CHANGED
|
@@ -30,14 +30,14 @@ module ForestLiana
|
|
|
30
30
|
expect(helper.parse_composite_id('["a","b"]')).to eq(['a', 'b'])
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
it '
|
|
34
|
-
expect(helper.parse_composite_id(
|
|
33
|
+
it 'parses composite ID in pipe-joined format (agent-client / workflow executor)' do
|
|
34
|
+
expect(helper.parse_composite_id('1|2')).to eq(['1', '2'])
|
|
35
|
+
expect(helper.parse_composite_id('10|20')).to eq(['10', '20'])
|
|
36
|
+
expect(helper.parse_composite_id('a|b')).to eq(['a', 'b'])
|
|
35
37
|
end
|
|
36
38
|
|
|
37
|
-
it '
|
|
38
|
-
expect
|
|
39
|
-
helper.parse_composite_id('invalid')
|
|
40
|
-
}.to raise_error(ForestLiana::Errors::HTTP422Error)
|
|
39
|
+
it 'returns array as-is when already an array' do
|
|
40
|
+
expect(helper.parse_composite_id([1, 2])).to eq([1, 2])
|
|
41
41
|
end
|
|
42
42
|
end
|
|
43
43
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: forest_liana
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 9.18.
|
|
4
|
+
version: 9.18.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sandro Munda
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-06-
|
|
11
|
+
date: 2026-06-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|