active_serialize 2.5.1 → 2.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_serialize.rb +2 -2
- data/lib/active_serialize/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28bc8d39ebfbcad77b2b0bbb36f201937b106e51
|
4
|
+
data.tar.gz: d9f850762dd5f7086b6853b6620ae676fd577c5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 850c92d5b014c3fb223311df710b1de298079e4f539385753e68d473b5930d542c170c31dd878b6a260651b03f56c2dd5b86f6d048b81d3720809a1b643f27ef
|
7
|
+
data.tar.gz: 9a5f3a05db53f7a621305b1e9a744d68f5d7790b8f21571d99055096b6423b6540eec3d92b218284c709d4409653fb5804c1bcec2759e1266e8ada2c41220043
|
data/lib/active_serialize.rb
CHANGED
@@ -35,10 +35,10 @@ module ActiveSerialize
|
|
35
35
|
recursion = (_active_serialize[:recursive] + recursive).map { |k| [ k, public_send(k)&.to_ha(*groups) ] }.to_h
|
36
36
|
merge.merge!(flat_add.map(&method(:public_send)).reduce({ }, :merge)) if flat_add.present?
|
37
37
|
keys = active_serialize_keys(*groups, rmv: rmv, add: add, **opts)
|
38
|
-
instance_exec(&keys[:if].first) \
|
38
|
+
keys = instance_exec(&keys[:if].first) \
|
39
39
|
? keys[:if].last[:only] || keys[:normal] + (keys[:if].last[:add] || [ ]) - (keys[:if].last[:rmv] || [ ])
|
40
40
|
: keys[:normal] \
|
41
|
-
|
41
|
+
if keys.is_a?(Hash)
|
42
42
|
|
43
43
|
KeyFormatter.(_active_serialize[:key_format],
|
44
44
|
keys.map { |key| [ key, public_send(key) ] }.to_h
|