active_model_serializers 0.8.2 → 0.8.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94274a9d3a573ae8f656719aef33825cabb68673
|
4
|
+
data.tar.gz: b1d614a90149ec109b67e963464c232d0b5ed3f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc3140d1676014d8ce4aa0add253d247c55652a689cb83e7f7f7a71a81ae8d7c601fc5e2d261d415e243857a479a15156d0a84a67beb1c72475ef51c063cdfca
|
7
|
+
data.tar.gz: cfc92ac9bb7dfca07cebdd32ef4a120aa5784cc7f1a6bfc8a65900b553be736b174b6bbf22fb7ebd55e8295ea1d118373245396e3c0ac883e954ab27e925bca2
|
@@ -33,19 +33,22 @@ module ActionController
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def serialization_scope
|
36
|
-
send(_serialization_scope) if _serialization_scope &&
|
36
|
+
send(_serialization_scope) if _serialization_scope &&
|
37
|
+
respond_to?(_serialization_scope, true)
|
37
38
|
end
|
38
39
|
|
39
40
|
def default_serializer_options
|
40
41
|
end
|
41
42
|
|
42
|
-
|
43
|
-
|
43
|
+
[:_render_option_json, :_render_with_renderer_json].each do |renderer_method|
|
44
|
+
define_method renderer_method do |resource, options|
|
45
|
+
json = ActiveModel::Serializer.build_json(self, resource, options)
|
44
46
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
47
|
+
if json
|
48
|
+
super(json, options)
|
49
|
+
else
|
50
|
+
super(resource, options)
|
51
|
+
end
|
49
52
|
end
|
50
53
|
end
|
51
54
|
|
data/test/serialization_test.rb
CHANGED
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_model_serializers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- José Valim
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-12-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activemodel
|
@@ -53,6 +53,20 @@ dependencies:
|
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: minitest
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
56
70
|
description: Making it easy to serialize models for client-side use
|
57
71
|
email:
|
58
72
|
- jose.valim@gmail.com
|