active_model_serializers 0.8.4 → 0.9.0.alpha1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -45
- data/CONTRIBUTING.md +20 -0
- data/DESIGN.textile +4 -4
- data/{MIT-LICENSE.txt → MIT-LICENSE} +0 -0
- data/README.md +187 -113
- data/lib/action_controller/serialization.rb +30 -16
- data/lib/active_model/array_serializer.rb +36 -82
- data/lib/active_model/default_serializer.rb +22 -0
- data/lib/active_model/serializable.rb +25 -0
- data/lib/active_model/serializer.rb +126 -447
- data/lib/active_model/serializer/associations.rb +53 -211
- data/lib/active_model/serializer/config.rb +31 -0
- data/lib/active_model/serializer/generators/resource_override.rb +13 -0
- data/lib/{generators → active_model/serializer/generators}/serializer/USAGE +0 -0
- data/lib/active_model/serializer/generators/serializer/scaffold_controller_generator.rb +14 -0
- data/lib/active_model/serializer/generators/serializer/serializer_generator.rb +37 -0
- data/lib/active_model/serializer/generators/serializer/templates/controller.rb +93 -0
- data/lib/active_model/serializer/generators/serializer/templates/serializer.rb +8 -0
- data/lib/active_model/serializer/railtie.rb +10 -0
- data/lib/active_model/{serializers → serializer}/version.rb +1 -1
- data/lib/active_model/serializer_support.rb +5 -0
- data/lib/active_model_serializers.rb +7 -86
- data/test/coverage_setup.rb +15 -0
- data/test/fixtures/active_record.rb +92 -0
- data/test/fixtures/poro.rb +64 -0
- data/test/integration/action_controller/serialization_test.rb +234 -0
- data/test/integration/active_record/active_record_test.rb +77 -0
- data/test/integration/generators/resource_generator_test.rb +26 -0
- data/test/integration/generators/scaffold_controller_generator_test.rb +67 -0
- data/test/integration/generators/serializer_generator_test.rb +41 -0
- data/test/test_app.rb +11 -0
- data/test/test_helper.rb +7 -41
- data/test/tmp/app/serializers/account_serializer.rb +3 -0
- data/test/unit/active_model/array_serializer/meta_test.rb +53 -0
- data/test/unit/active_model/array_serializer/root_test.rb +102 -0
- data/test/unit/active_model/array_serializer/scope_test.rb +24 -0
- data/test/unit/active_model/array_serializer/serialization_test.rb +83 -0
- data/test/unit/active_model/default_serializer_test.rb +13 -0
- data/test/unit/active_model/serializer/associations/build_serializer_test.rb +21 -0
- data/test/unit/active_model/serializer/associations_test.rb +19 -0
- data/test/unit/active_model/serializer/attributes_test.rb +41 -0
- data/test/unit/active_model/serializer/config_test.rb +86 -0
- data/test/unit/active_model/serializer/filter_test.rb +49 -0
- data/test/unit/active_model/serializer/has_many_test.rb +173 -0
- data/test/unit/active_model/serializer/has_one_test.rb +151 -0
- data/test/unit/active_model/serializer/meta_test.rb +39 -0
- data/test/unit/active_model/serializer/root_test.rb +117 -0
- data/test/unit/active_model/serializer/scope_test.rb +49 -0
- metadata +78 -74
- data/.gitignore +0 -18
- data/.travis.yml +0 -34
- data/Gemfile +0 -38
- data/Rakefile +0 -22
- data/active_model_serializers.gemspec +0 -24
- data/appveyor.yml +0 -27
- data/bench/perf.rb +0 -43
- data/cruft.md +0 -19
- data/lib/active_record/serializer_override.rb +0 -16
- data/lib/generators/resource_override.rb +0 -13
- data/lib/generators/serializer/serializer_generator.rb +0 -42
- data/lib/generators/serializer/templates/serializer.rb +0 -19
- data/test/array_serializer_test.rb +0 -75
- data/test/association_test.rb +0 -592
- data/test/caching_test.rb +0 -177
- data/test/generators_test.rb +0 -85
- data/test/no_serialization_scope_test.rb +0 -34
- data/test/serialization_scope_name_test.rb +0 -67
- data/test/serialization_test.rb +0 -396
- data/test/serializer_support_test.rb +0 -51
- data/test/serializer_test.rb +0 -1466
- data/test/test_fakes.rb +0 -218
@@ -0,0 +1,151 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module ActiveModel
|
4
|
+
class Serializer
|
5
|
+
class HasOneTest < ActiveModel::TestCase
|
6
|
+
def setup
|
7
|
+
@association = UserSerializer._associations[:profile]
|
8
|
+
@old_association = @association.dup
|
9
|
+
|
10
|
+
@user = User.new({ name: 'Name 1', email: 'mail@server.com', gender: 'M' })
|
11
|
+
@user_serializer = UserSerializer.new(@user)
|
12
|
+
end
|
13
|
+
|
14
|
+
def teardown
|
15
|
+
UserSerializer._associations[:profile] = @old_association
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_associations_definition
|
19
|
+
assert_equal 1, UserSerializer._associations.length
|
20
|
+
assert_kind_of Association::HasOne, @association
|
21
|
+
assert_equal 'profile', @association.name
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_associations_embedding_ids_serialization_using_serializable_hash
|
25
|
+
@association.embed = :ids
|
26
|
+
|
27
|
+
assert_equal({
|
28
|
+
name: 'Name 1', email: 'mail@server.com', 'profile_id' => @user.profile.object_id
|
29
|
+
}, @user_serializer.serializable_hash)
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_associations_embedding_ids_serialization_using_as_json
|
33
|
+
@association.embed = :ids
|
34
|
+
|
35
|
+
assert_equal({
|
36
|
+
'user' => { name: 'Name 1', email: 'mail@server.com', 'profile_id' => @user.profile.object_id }
|
37
|
+
}, @user_serializer.as_json)
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_associations_embedding_ids_serialization_using_serializable_hash_and_key_from_options
|
41
|
+
@association.embed = :ids
|
42
|
+
@association.key = 'key'
|
43
|
+
|
44
|
+
assert_equal({
|
45
|
+
name: 'Name 1', email: 'mail@server.com', 'key' => @user.profile.object_id
|
46
|
+
}, @user_serializer.serializable_hash)
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_associations_embedding_objects_serialization_using_serializable_hash
|
50
|
+
@association.embed = :objects
|
51
|
+
|
52
|
+
assert_equal({
|
53
|
+
name: 'Name 1', email: 'mail@server.com', profile: { name: 'N1', description: 'D1' }
|
54
|
+
}, @user_serializer.serializable_hash)
|
55
|
+
end
|
56
|
+
|
57
|
+
def test_associations_embedding_objects_serialization_using_as_json
|
58
|
+
@association.embed = :objects
|
59
|
+
|
60
|
+
assert_equal({
|
61
|
+
'user' => { name: 'Name 1', email: 'mail@server.com', profile: { name: 'N1', description: 'D1' } }
|
62
|
+
}, @user_serializer.as_json)
|
63
|
+
end
|
64
|
+
|
65
|
+
def test_associations_embedding_nil_ids_serialization_using_as_json
|
66
|
+
@association.embed = :ids
|
67
|
+
@user.instance_eval do
|
68
|
+
def profile
|
69
|
+
nil
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
assert_equal({
|
74
|
+
'user' => { name: 'Name 1', email: 'mail@server.com', 'profile_id' => nil }
|
75
|
+
}, @user_serializer.as_json)
|
76
|
+
end
|
77
|
+
|
78
|
+
def test_associations_embedding_nil_objects_serialization_using_as_json
|
79
|
+
@association.embed = :objects
|
80
|
+
@user.instance_eval do
|
81
|
+
def profile
|
82
|
+
nil
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
assert_equal({
|
87
|
+
'user' => { name: 'Name 1', email: 'mail@server.com', profile: nil }
|
88
|
+
}, @user_serializer.as_json)
|
89
|
+
end
|
90
|
+
|
91
|
+
def test_associations_embedding_objects_serialization_using_serializable_hash_and_root_from_options
|
92
|
+
@association.embed = :objects
|
93
|
+
@association.embedded_key = 'root'
|
94
|
+
|
95
|
+
assert_equal({
|
96
|
+
name: 'Name 1', email: 'mail@server.com', 'root' => { name: 'N1', description: 'D1' }
|
97
|
+
}, @user_serializer.serializable_hash)
|
98
|
+
end
|
99
|
+
|
100
|
+
def test_associations_embedding_ids_including_objects_serialization_using_serializable_hash
|
101
|
+
@association.embed = :ids
|
102
|
+
@association.embed_in_root = true
|
103
|
+
|
104
|
+
assert_equal({
|
105
|
+
name: 'Name 1', email: 'mail@server.com', 'profile_id' => @user.profile.object_id
|
106
|
+
}, @user_serializer.serializable_hash)
|
107
|
+
end
|
108
|
+
|
109
|
+
def test_associations_embedding_ids_including_objects_serialization_using_as_json
|
110
|
+
@association.embed = :ids
|
111
|
+
@association.embed_in_root = true
|
112
|
+
|
113
|
+
assert_equal({
|
114
|
+
'user' => { name: 'Name 1', email: 'mail@server.com', 'profile_id' => @user.profile.object_id },
|
115
|
+
'profiles' => [{ name: 'N1', description: 'D1' }]
|
116
|
+
}, @user_serializer.as_json)
|
117
|
+
end
|
118
|
+
|
119
|
+
def test_associations_embedding_ids_using_a_given_serializer
|
120
|
+
@association.embed = :ids
|
121
|
+
@association.embed_in_root = true
|
122
|
+
@association.serializer_class = Class.new(ActiveModel::Serializer) do
|
123
|
+
def name
|
124
|
+
'fake'
|
125
|
+
end
|
126
|
+
|
127
|
+
attributes :name
|
128
|
+
end
|
129
|
+
|
130
|
+
assert_equal({
|
131
|
+
'user' => { name: 'Name 1', email: 'mail@server.com', 'profile_id' => @user.profile.object_id },
|
132
|
+
'profiles' => [{ name: 'fake' }]
|
133
|
+
}, @user_serializer.as_json)
|
134
|
+
end
|
135
|
+
|
136
|
+
def test_associations_embedding_objects_using_a_given_serializer
|
137
|
+
@association.serializer_class = Class.new(ActiveModel::Serializer) do
|
138
|
+
def name
|
139
|
+
'fake'
|
140
|
+
end
|
141
|
+
|
142
|
+
attributes :name
|
143
|
+
end
|
144
|
+
|
145
|
+
assert_equal({
|
146
|
+
'user' => { name: 'Name 1', email: 'mail@server.com', profile: { name: 'fake' } }
|
147
|
+
}, @user_serializer.as_json)
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module ActiveModel
|
4
|
+
class Serializer
|
5
|
+
class MetaTest < ActiveModel::TestCase
|
6
|
+
def setup
|
7
|
+
@profile = Profile.new({ name: 'Name 1', description: 'Description 1', comments: 'Comments 1' })
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_meta
|
11
|
+
profile_serializer = ProfileSerializer.new(@profile, root: 'profile', meta: { total: 10 })
|
12
|
+
|
13
|
+
assert_equal({
|
14
|
+
'profile' => {
|
15
|
+
name: 'Name 1',
|
16
|
+
description: 'Description 1'
|
17
|
+
},
|
18
|
+
meta: {
|
19
|
+
total: 10
|
20
|
+
}
|
21
|
+
}, profile_serializer.as_json)
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_meta_using_meta_key
|
25
|
+
profile_serializer = ProfileSerializer.new(@profile, root: 'profile', meta_key: :my_meta, my_meta: { total: 10 })
|
26
|
+
|
27
|
+
assert_equal({
|
28
|
+
'profile' => {
|
29
|
+
name: 'Name 1',
|
30
|
+
description: 'Description 1'
|
31
|
+
},
|
32
|
+
my_meta: {
|
33
|
+
total: 10
|
34
|
+
}
|
35
|
+
}, profile_serializer.as_json)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,117 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module ActiveModel
|
4
|
+
class Serializer
|
5
|
+
class RootAsOptionTest < ActiveModel::TestCase
|
6
|
+
def setup
|
7
|
+
@old_root = ProfileSerializer._root
|
8
|
+
@profile = Profile.new({ name: 'Name 1', description: 'Description 1', comments: 'Comments 1' })
|
9
|
+
@serializer = ProfileSerializer.new(@profile, root: :initialize)
|
10
|
+
ProfileSerializer._root = true
|
11
|
+
end
|
12
|
+
|
13
|
+
def teardown
|
14
|
+
ProfileSerializer._root = @old_root
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_root_is_not_displayed_using_serializable_hash
|
18
|
+
assert_equal({
|
19
|
+
name: 'Name 1', description: 'Description 1'
|
20
|
+
}, @serializer.serializable_hash)
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_root_using_as_json
|
24
|
+
assert_equal({
|
25
|
+
initialize: {
|
26
|
+
name: 'Name 1', description: 'Description 1'
|
27
|
+
}
|
28
|
+
}, @serializer.as_json)
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_root_from_serializer_name
|
32
|
+
@serializer = ProfileSerializer.new(@profile)
|
33
|
+
|
34
|
+
assert_equal({
|
35
|
+
'profile' => {
|
36
|
+
name: 'Name 1', description: 'Description 1'
|
37
|
+
}
|
38
|
+
}, @serializer.as_json)
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_root_as_argument_takes_precedence
|
42
|
+
assert_equal({
|
43
|
+
argument: {
|
44
|
+
name: 'Name 1', description: 'Description 1'
|
45
|
+
}
|
46
|
+
}, @serializer.as_json(root: :argument))
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_using_false_root_in_initializer_takes_precedence
|
50
|
+
ProfileSerializer._root = 'root'
|
51
|
+
@serializer = ProfileSerializer.new(@profile, root: false)
|
52
|
+
|
53
|
+
assert_equal({
|
54
|
+
name: 'Name 1', description: 'Description 1'
|
55
|
+
}, @serializer.as_json)
|
56
|
+
end
|
57
|
+
|
58
|
+
def test_root_inheritance
|
59
|
+
ProfileSerializer._root = 'profile'
|
60
|
+
|
61
|
+
inherited_serializer_klass = Class.new(ProfileSerializer)
|
62
|
+
inherited_serializer_klass._root = 'inherited_profile'
|
63
|
+
|
64
|
+
another_inherited_serializer_klass = Class.new(ProfileSerializer)
|
65
|
+
|
66
|
+
assert_equal('inherited_profile',
|
67
|
+
inherited_serializer_klass._root)
|
68
|
+
assert_equal('profile',
|
69
|
+
another_inherited_serializer_klass._root)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
class RootInSerializerTest < ActiveModel::TestCase
|
74
|
+
def setup
|
75
|
+
@old_root = ProfileSerializer._root
|
76
|
+
ProfileSerializer._root = :in_serializer
|
77
|
+
profile = Profile.new({ name: 'Name 1', description: 'Description 1', comments: 'Comments 1' })
|
78
|
+
@serializer = ProfileSerializer.new(profile)
|
79
|
+
@rooted_serializer = ProfileSerializer.new(profile, root: :initialize)
|
80
|
+
end
|
81
|
+
|
82
|
+
def teardown
|
83
|
+
ProfileSerializer._root = @old_root
|
84
|
+
end
|
85
|
+
|
86
|
+
def test_root_is_not_displayed_using_serializable_hash
|
87
|
+
assert_equal({
|
88
|
+
name: 'Name 1', description: 'Description 1'
|
89
|
+
}, @serializer.serializable_hash)
|
90
|
+
end
|
91
|
+
|
92
|
+
def test_root_using_as_json
|
93
|
+
assert_equal({
|
94
|
+
in_serializer: {
|
95
|
+
name: 'Name 1', description: 'Description 1'
|
96
|
+
}
|
97
|
+
}, @serializer.as_json)
|
98
|
+
end
|
99
|
+
|
100
|
+
def test_root_in_initializer_takes_precedence
|
101
|
+
assert_equal({
|
102
|
+
initialize: {
|
103
|
+
name: 'Name 1', description: 'Description 1'
|
104
|
+
}
|
105
|
+
}, @rooted_serializer.as_json)
|
106
|
+
end
|
107
|
+
|
108
|
+
def test_root_as_argument_takes_precedence
|
109
|
+
assert_equal({
|
110
|
+
argument: {
|
111
|
+
name: 'Name 1', description: 'Description 1'
|
112
|
+
}
|
113
|
+
}, @rooted_serializer.as_json(root: :argument))
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module ActiveModel
|
4
|
+
class Serializer
|
5
|
+
class ScopeTest < ActiveModel::TestCase
|
6
|
+
def setup
|
7
|
+
@serializer = ProfileSerializer.new(nil, scope: current_user)
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_scope
|
11
|
+
assert_equal('user', @serializer.scope)
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def current_user
|
17
|
+
'user'
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
class NestedScopeTest < ActiveModel::TestCase
|
22
|
+
def setup
|
23
|
+
@association = UserSerializer._associations[:profile]
|
24
|
+
@old_association = @association.dup
|
25
|
+
@user = User.new({ name: 'Name 1', email: 'mail@server.com', gender: 'M' })
|
26
|
+
@user_serializer = UserSerializer.new(@user, scope: 'user')
|
27
|
+
end
|
28
|
+
|
29
|
+
def teardown
|
30
|
+
UserSerializer._associations[:profile] = @old_association
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_scope_passed_through
|
34
|
+
@association.serializer_class = Class.new(ActiveModel::Serializer) do
|
35
|
+
def name
|
36
|
+
scope
|
37
|
+
end
|
38
|
+
|
39
|
+
attributes :name
|
40
|
+
end
|
41
|
+
|
42
|
+
assert_equal({
|
43
|
+
name: 'Name 1', email: 'mail@server.com', profile: { name: 'user' }
|
44
|
+
}, @user_serializer.serializable_hash)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
metadata
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_model_serializers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0.alpha1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- José Valim
|
8
8
|
- Yehuda Katz
|
9
|
+
- Santiago Pastorino
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date:
|
13
|
+
date: 2014-01-07 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: activemodel
|
@@ -17,100 +18,88 @@ dependencies:
|
|
17
18
|
requirements:
|
18
19
|
- - ">="
|
19
20
|
- !ruby/object:Gem::Version
|
20
|
-
version: '3.
|
21
|
+
version: '3.2'
|
21
22
|
type: :runtime
|
22
23
|
prerelease: false
|
23
24
|
version_requirements: !ruby/object:Gem::Requirement
|
24
25
|
requirements:
|
25
26
|
- - ">="
|
26
27
|
- !ruby/object:Gem::Version
|
27
|
-
version: '3.
|
28
|
+
version: '3.2'
|
28
29
|
- !ruby/object:Gem::Dependency
|
29
30
|
name: rails
|
30
31
|
requirement: !ruby/object:Gem::Requirement
|
31
32
|
requirements:
|
32
33
|
- - ">="
|
33
34
|
- !ruby/object:Gem::Version
|
34
|
-
version: '3.
|
35
|
+
version: '3.2'
|
35
36
|
type: :development
|
36
37
|
prerelease: false
|
37
38
|
version_requirements: !ruby/object:Gem::Requirement
|
38
39
|
requirements:
|
39
40
|
- - ">="
|
40
41
|
- !ruby/object:Gem::Version
|
41
|
-
version: '3.
|
42
|
-
- !ruby/object:Gem::Dependency
|
43
|
-
name: pry
|
44
|
-
requirement: !ruby/object:Gem::Requirement
|
45
|
-
requirements:
|
46
|
-
- - ">="
|
47
|
-
- !ruby/object:Gem::Version
|
48
|
-
version: '0'
|
49
|
-
type: :development
|
50
|
-
prerelease: false
|
51
|
-
version_requirements: !ruby/object:Gem::Requirement
|
52
|
-
requirements:
|
53
|
-
- - ">="
|
54
|
-
- !ruby/object:Gem::Version
|
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'
|
42
|
+
version: '3.2'
|
70
43
|
description: Making it easy to serialize models for client-side use
|
71
44
|
email:
|
72
45
|
- jose.valim@gmail.com
|
73
46
|
- wycats@gmail.com
|
47
|
+
- santiago@wyeworks.com
|
74
48
|
executables: []
|
75
49
|
extensions: []
|
76
50
|
extra_rdoc_files: []
|
77
51
|
files:
|
78
|
-
- ".gitignore"
|
79
|
-
- ".travis.yml"
|
80
52
|
- CHANGELOG.md
|
53
|
+
- CONTRIBUTING.md
|
81
54
|
- DESIGN.textile
|
82
|
-
-
|
83
|
-
- MIT-LICENSE.txt
|
55
|
+
- MIT-LICENSE
|
84
56
|
- README.md
|
85
|
-
- Rakefile
|
86
|
-
- active_model_serializers.gemspec
|
87
|
-
- appveyor.yml
|
88
|
-
- bench/perf.rb
|
89
|
-
- cruft.md
|
90
57
|
- lib/action_controller/serialization.rb
|
91
58
|
- lib/active_model/array_serializer.rb
|
59
|
+
- lib/active_model/default_serializer.rb
|
60
|
+
- lib/active_model/serializable.rb
|
92
61
|
- lib/active_model/serializer.rb
|
93
62
|
- lib/active_model/serializer/associations.rb
|
94
|
-
- lib/active_model/
|
63
|
+
- lib/active_model/serializer/config.rb
|
64
|
+
- lib/active_model/serializer/generators/resource_override.rb
|
65
|
+
- lib/active_model/serializer/generators/serializer/USAGE
|
66
|
+
- lib/active_model/serializer/generators/serializer/scaffold_controller_generator.rb
|
67
|
+
- lib/active_model/serializer/generators/serializer/serializer_generator.rb
|
68
|
+
- lib/active_model/serializer/generators/serializer/templates/controller.rb
|
69
|
+
- lib/active_model/serializer/generators/serializer/templates/serializer.rb
|
70
|
+
- lib/active_model/serializer/railtie.rb
|
71
|
+
- lib/active_model/serializer/version.rb
|
72
|
+
- lib/active_model/serializer_support.rb
|
95
73
|
- lib/active_model_serializers.rb
|
96
|
-
-
|
97
|
-
-
|
98
|
-
-
|
99
|
-
-
|
100
|
-
-
|
101
|
-
- test/
|
102
|
-
- test/
|
103
|
-
- test/
|
104
|
-
- test/
|
105
|
-
- test/no_serialization_scope_test.rb
|
106
|
-
- test/serialization_scope_name_test.rb
|
107
|
-
- test/serialization_test.rb
|
108
|
-
- test/serializer_support_test.rb
|
109
|
-
- test/serializer_test.rb
|
110
|
-
- test/test_fakes.rb
|
74
|
+
- test/coverage_setup.rb
|
75
|
+
- test/fixtures/active_record.rb
|
76
|
+
- test/fixtures/poro.rb
|
77
|
+
- test/integration/action_controller/serialization_test.rb
|
78
|
+
- test/integration/active_record/active_record_test.rb
|
79
|
+
- test/integration/generators/resource_generator_test.rb
|
80
|
+
- test/integration/generators/scaffold_controller_generator_test.rb
|
81
|
+
- test/integration/generators/serializer_generator_test.rb
|
82
|
+
- test/test_app.rb
|
111
83
|
- test/test_helper.rb
|
84
|
+
- test/tmp/app/serializers/account_serializer.rb
|
85
|
+
- test/unit/active_model/array_serializer/meta_test.rb
|
86
|
+
- test/unit/active_model/array_serializer/root_test.rb
|
87
|
+
- test/unit/active_model/array_serializer/scope_test.rb
|
88
|
+
- test/unit/active_model/array_serializer/serialization_test.rb
|
89
|
+
- test/unit/active_model/default_serializer_test.rb
|
90
|
+
- test/unit/active_model/serializer/associations/build_serializer_test.rb
|
91
|
+
- test/unit/active_model/serializer/associations_test.rb
|
92
|
+
- test/unit/active_model/serializer/attributes_test.rb
|
93
|
+
- test/unit/active_model/serializer/config_test.rb
|
94
|
+
- test/unit/active_model/serializer/filter_test.rb
|
95
|
+
- test/unit/active_model/serializer/has_many_test.rb
|
96
|
+
- test/unit/active_model/serializer/has_one_test.rb
|
97
|
+
- test/unit/active_model/serializer/meta_test.rb
|
98
|
+
- test/unit/active_model/serializer/root_test.rb
|
99
|
+
- test/unit/active_model/serializer/scope_test.rb
|
112
100
|
homepage: https://github.com/rails-api/active_model_serializers
|
113
|
-
licenses:
|
101
|
+
licenses:
|
102
|
+
- MIT
|
114
103
|
metadata: {}
|
115
104
|
post_install_message:
|
116
105
|
rdoc_options: []
|
@@ -120,28 +109,43 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
120
109
|
requirements:
|
121
110
|
- - ">="
|
122
111
|
- !ruby/object:Gem::Version
|
123
|
-
version:
|
112
|
+
version: 1.9.3
|
124
113
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
114
|
requirements:
|
126
|
-
- - "
|
115
|
+
- - ">"
|
127
116
|
- !ruby/object:Gem::Version
|
128
|
-
version:
|
117
|
+
version: 1.3.1
|
129
118
|
requirements: []
|
130
119
|
rubyforge_project:
|
131
|
-
rubygems_version: 2.
|
120
|
+
rubygems_version: 2.2.0
|
132
121
|
signing_key:
|
133
122
|
specification_version: 4
|
134
123
|
summary: Bringing consistency and object orientation to model serialization. Works
|
135
124
|
great for client-side MVC frameworks!
|
136
125
|
test_files:
|
137
|
-
- test/
|
138
|
-
- test/
|
139
|
-
- test/
|
140
|
-
- test/
|
141
|
-
- test/
|
142
|
-
- test/
|
143
|
-
- test/
|
144
|
-
- test/
|
145
|
-
- test/
|
146
|
-
- test/test_fakes.rb
|
126
|
+
- test/coverage_setup.rb
|
127
|
+
- test/fixtures/active_record.rb
|
128
|
+
- test/fixtures/poro.rb
|
129
|
+
- test/integration/action_controller/serialization_test.rb
|
130
|
+
- test/integration/active_record/active_record_test.rb
|
131
|
+
- test/integration/generators/resource_generator_test.rb
|
132
|
+
- test/integration/generators/scaffold_controller_generator_test.rb
|
133
|
+
- test/integration/generators/serializer_generator_test.rb
|
134
|
+
- test/test_app.rb
|
147
135
|
- test/test_helper.rb
|
136
|
+
- test/tmp/app/serializers/account_serializer.rb
|
137
|
+
- test/unit/active_model/array_serializer/meta_test.rb
|
138
|
+
- test/unit/active_model/array_serializer/root_test.rb
|
139
|
+
- test/unit/active_model/array_serializer/scope_test.rb
|
140
|
+
- test/unit/active_model/array_serializer/serialization_test.rb
|
141
|
+
- test/unit/active_model/default_serializer_test.rb
|
142
|
+
- test/unit/active_model/serializer/associations/build_serializer_test.rb
|
143
|
+
- test/unit/active_model/serializer/associations_test.rb
|
144
|
+
- test/unit/active_model/serializer/attributes_test.rb
|
145
|
+
- test/unit/active_model/serializer/config_test.rb
|
146
|
+
- test/unit/active_model/serializer/filter_test.rb
|
147
|
+
- test/unit/active_model/serializer/has_many_test.rb
|
148
|
+
- test/unit/active_model/serializer/has_one_test.rb
|
149
|
+
- test/unit/active_model/serializer/meta_test.rb
|
150
|
+
- test/unit/active_model/serializer/root_test.rb
|
151
|
+
- test/unit/active_model/serializer/scope_test.rb
|