active_record_to_hash 1.1.0 → 1.2.0
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20265c61f8ff4e0694c84ab3ffaf7b7e18682a3691b96f2d2c308b9e5be3cd4f
|
4
|
+
data.tar.gz: 603bd1960eda432c40686cd7a34ec4ec03c45680f66a6195eb9ab021606832a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1659acaeb6f1eba556b735690b9f5aa1aabb0a4e19b5a71320e59dbf059a8b9c893a81fb8bef698b68e57a77f142843f025323b86cfb25233b27183cf7135f82
|
7
|
+
data.tar.gz: 60d3a968325e50cb34979f2abbd57ed6f450332ee58fc24d2c2457a9c43839185ea44dae1612e1eeba0f313025b87ddd5483ee8404188f85d5eeb6ebab9b1e12
|
@@ -23,6 +23,8 @@ module ActiveRecordToHash
|
|
23
23
|
|
24
24
|
ActiveRecordToHash.handle_with_options(options) do |hash_key, attr_name, child_options|
|
25
25
|
child = ActiveRecordToHash.retrieve_child_attribute(self, attr_name, child_options, __callee__)
|
26
|
+
next if child_options[:optional] == true && child.blank?
|
27
|
+
|
26
28
|
result[hash_key] = ActiveRecordToHash.handle_alter(child, child_options)
|
27
29
|
end
|
28
30
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_record_to_hash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masamoto Miyata
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
11
|
+
date: 2022-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|