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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f0a81eb1f2145ece2d057636e2021baad5dd37c7
4
- data.tar.gz: 4bb5c2a4768d42f7f4eee7475c66c7e7d0e99085
3
+ metadata.gz: 28bc8d39ebfbcad77b2b0bbb36f201937b106e51
4
+ data.tar.gz: d9f850762dd5f7086b6853b6620ae676fd577c5b
5
5
  SHA512:
6
- metadata.gz: b7ecff72c8e297875b1f305039d8ea2e99ea42180075242e7a91a0b7b030624e2105c50617904648636d2c9c6d6b190f2ed307277dd9b1b37959fe260563195f
7
- data.tar.gz: 58abc1ca68a47f01d1e790aacdf4076e5bfa8700572f640a7e42edf9ac521c26476b2bb29514db4c9b0613554f3fa460cb28fa3973c67149152942802ec13705
6
+ metadata.gz: 850c92d5b014c3fb223311df710b1de298079e4f539385753e68d473b5930d542c170c31dd878b6a260651b03f56c2dd5b86f6d048b81d3720809a1b643f27ef
7
+ data.tar.gz: 9a5f3a05db53f7a621305b1e9a744d68f5d7790b8f21571d99055096b6423b6540eec3d92b218284c709d4409653fb5804c1bcec2759e1266e8ada2c41220043
@@ -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
- if keys.is_a?(Hash)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveSerialize
4
- VERSION = '2.5.1'
4
+ VERSION = '2.5.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_serialize
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.1
4
+ version: 2.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - zhandao