ar_json_serialize 0.0.1 → 0.0.2
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 +14 -6
- data/README.md +3 -1
- data/lib/ar_json_serialize/serializer.rb +3 -6
- data/lib/ar_json_serialize/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
!binary "U0hBMQ==":
|
|
3
|
+
metadata.gz: !binary |-
|
|
4
|
+
OGJhMjJlN2Q5ODkwZTkzNjZkZjU0MjNiYjM5YTU2MmY1MjRhMTQyMw==
|
|
5
|
+
data.tar.gz: !binary |-
|
|
6
|
+
MmQ1NWZlMzgwNDg2YjVkMjg4M2JjNTM5OGQ0NDQ4MmI4NTgzNTk0MQ==
|
|
7
|
+
!binary "U0hBNTEy":
|
|
8
|
+
metadata.gz: !binary |-
|
|
9
|
+
NTUxZjIxNTU2YTFlZGI1Mzg5M2I5ZDcxNGMxNzc4ZGYyNDU5NmUxZTVkYWZh
|
|
10
|
+
ZmYzY2YyZjdmYThmYTk1MDNmOTZiN2M4MDYzZGI3ZTg3NThiMWY1M2QxZWE0
|
|
11
|
+
NjU3YjMzZjYzZjIwYzk4ZTRlNjJmN2IyYWM5YjczM2VlZDBkZGI=
|
|
12
|
+
data.tar.gz: !binary |-
|
|
13
|
+
YWI0YmYyNTdkYTM3ZjNhNzg1MTM2Y2Y5MzljYTg5YzZjNzA3YzBlZmQwNDky
|
|
14
|
+
MTI2YWZlNTk2NzY2NWU0MGQ0MDg1MmEwZDcwM2JmMmM1ZTY5MjE3MzZlZDdj
|
|
15
|
+
OTcyMzU1MDRmNDNjMDcxZDg5NjEzODU5OTEzOTRlYmE1YjZmOWQ=
|
data/README.md
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ActiveRecord Json Serialize
|
|
2
|
+
[](https://coveralls.io/r/phenomena/ar_json_serialize?branch=master)[](https://travis-ci.org/phenomena/ar_json_serialize)[](http://badge.fury.io/rb/ar_json_serialize)[](https://codeclimate.com/github/dotpromo/ar_json_serialize)
|
|
3
|
+
|
|
2
4
|
ActiveRecord JSON serializer
|
|
3
5
|
|
|
4
6
|
## Installation
|
|
@@ -4,17 +4,13 @@ module ArJsonSerialize
|
|
|
4
4
|
|
|
5
5
|
def load(s)
|
|
6
6
|
if s.present?
|
|
7
|
-
result = ::MultiJson.load(s)
|
|
7
|
+
result = ::MultiJson.load(s) rescue s
|
|
8
8
|
case result
|
|
9
9
|
when ::Hash
|
|
10
10
|
::Hashie::Mash.new(result)
|
|
11
11
|
when ::Array
|
|
12
12
|
result.map do |item|
|
|
13
|
-
|
|
14
|
-
::Hashie::Mash.new(item)
|
|
15
|
-
else
|
|
16
|
-
item
|
|
17
|
-
end
|
|
13
|
+
item.is_a?(::Hash) ? ::Hashie::Mash.new(item) : item
|
|
18
14
|
end
|
|
19
15
|
else
|
|
20
16
|
result
|
|
@@ -27,5 +23,6 @@ module ArJsonSerialize
|
|
|
27
23
|
def dump(s)
|
|
28
24
|
::MultiJson.dump(s)
|
|
29
25
|
end
|
|
26
|
+
|
|
30
27
|
end
|
|
31
28
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ar_json_serialize
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alexander Simonov
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-
|
|
11
|
+
date: 2013-08-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: multi_json
|
|
@@ -42,7 +42,7 @@ dependencies:
|
|
|
42
42
|
name: activerecord
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
|
-
- - '>='
|
|
45
|
+
- - ! '>='
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
47
|
version: 3.2.13
|
|
48
48
|
- - <
|
|
@@ -52,7 +52,7 @@ dependencies:
|
|
|
52
52
|
prerelease: false
|
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
|
54
54
|
requirements:
|
|
55
|
-
- - '>='
|
|
55
|
+
- - ! '>='
|
|
56
56
|
- !ruby/object:Gem::Version
|
|
57
57
|
version: 3.2.13
|
|
58
58
|
- - <
|
|
@@ -76,14 +76,14 @@ dependencies:
|
|
|
76
76
|
name: rake
|
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
|
78
78
|
requirements:
|
|
79
|
-
- - '>='
|
|
79
|
+
- - ! '>='
|
|
80
80
|
- !ruby/object:Gem::Version
|
|
81
81
|
version: '0'
|
|
82
82
|
type: :development
|
|
83
83
|
prerelease: false
|
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
|
85
85
|
requirements:
|
|
86
|
-
- - '>='
|
|
86
|
+
- - ! '>='
|
|
87
87
|
- !ruby/object:Gem::Version
|
|
88
88
|
version: '0'
|
|
89
89
|
description: ActiveRecord JSON serializer
|
|
@@ -119,12 +119,12 @@ require_paths:
|
|
|
119
119
|
- lib
|
|
120
120
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
121
121
|
requirements:
|
|
122
|
-
- - '>='
|
|
122
|
+
- - ! '>='
|
|
123
123
|
- !ruby/object:Gem::Version
|
|
124
124
|
version: '0'
|
|
125
125
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
126
|
requirements:
|
|
127
|
-
- - '>='
|
|
127
|
+
- - ! '>='
|
|
128
128
|
- !ruby/object:Gem::Version
|
|
129
129
|
version: '0'
|
|
130
130
|
requirements: []
|