duck_record 0.0.15 → 0.0.16
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/duck_record/serialization.rb +6 -7
- data/lib/duck_record/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: 50cfc614adaa1a3af48769d41305d88b4ace7149
|
|
4
|
+
data.tar.gz: ba8306b2ac4d88f8e7e69600e6398f6312132746
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d8249209d1c8315953b4b5404b4f591bc9138a24d04fc4af0c9c8c7d75b277a827721b5a2431695baea747b3a0fffe1be460e814b979180853ab3c4f7255769d
|
|
7
|
+
data.tar.gz: f7a092d53c15c85a5938d6558f66d93c4b9f01d1db23e561b76fedfa764d2bfd054270fd622d987c6a740b0994ffa22063ab336c490bf943abef5e554d8acc17
|
|
@@ -8,19 +8,18 @@ module DuckRecord #:nodoc:
|
|
|
8
8
|
self.include_root_in_json = false
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
def serializable_hash(options =
|
|
12
|
-
options = options
|
|
13
|
-
|
|
14
|
-
options[:except] = Array(options[:except]).map(&:to_s)
|
|
15
|
-
|
|
16
|
-
super(options)
|
|
11
|
+
def serializable_hash(options = {})
|
|
12
|
+
options = (options || {}).reverse_merge except: Array(options[:except]).map(&:to_s)
|
|
13
|
+
super options
|
|
17
14
|
end
|
|
18
15
|
|
|
19
16
|
private
|
|
20
17
|
|
|
21
18
|
def read_attribute_for_serialization(key)
|
|
22
19
|
v = send(key)
|
|
23
|
-
if v.respond_to?(:
|
|
20
|
+
if v.respond_to?(:serializable_hash)
|
|
21
|
+
v.serializable_hash
|
|
22
|
+
elsif v.respond_to?(:to_ary)
|
|
24
23
|
v.to_ary
|
|
25
24
|
elsif v.respond_to?(:to_hash)
|
|
26
25
|
v.to_hash
|
data/lib/duck_record/version.rb
CHANGED