active_model_serializers 0.10.0 → 0.10.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (206) hide show
  1. checksums.yaml +5 -5
  2. data/.rubocop.yml +10 -5
  3. data/.travis.yml +41 -21
  4. data/CHANGELOG.md +200 -2
  5. data/CODE_OF_CONDUCT.md +74 -0
  6. data/Gemfile +25 -4
  7. data/README.md +166 -28
  8. data/Rakefile +5 -32
  9. data/active_model_serializers.gemspec +23 -25
  10. data/appveyor.yml +10 -6
  11. data/bin/rubocop +38 -0
  12. data/docs/README.md +2 -1
  13. data/docs/general/adapters.md +35 -11
  14. data/docs/general/caching.md +7 -1
  15. data/docs/general/configuration_options.md +86 -1
  16. data/docs/general/deserialization.md +1 -1
  17. data/docs/general/fields.md +31 -0
  18. data/docs/general/getting_started.md +1 -1
  19. data/docs/general/logging.md +7 -0
  20. data/docs/general/rendering.md +63 -25
  21. data/docs/general/serializers.md +137 -14
  22. data/docs/howto/add_pagination_links.md +16 -17
  23. data/docs/howto/add_relationship_links.md +140 -0
  24. data/docs/howto/add_root_key.md +11 -0
  25. data/docs/howto/grape_integration.md +42 -0
  26. data/docs/howto/outside_controller_use.md +12 -4
  27. data/docs/howto/passing_arbitrary_options.md +2 -2
  28. data/docs/howto/serialize_poro.md +46 -5
  29. data/docs/howto/test.md +2 -0
  30. data/docs/howto/upgrade_from_0_8_to_0_10.md +265 -0
  31. data/docs/integrations/ember-and-json-api.md +67 -32
  32. data/docs/jsonapi/schema.md +1 -1
  33. data/lib/action_controller/serialization.rb +15 -3
  34. data/lib/active_model/serializable_resource.rb +2 -0
  35. data/lib/active_model/serializer/adapter/attributes.rb +2 -0
  36. data/lib/active_model/serializer/adapter/base.rb +4 -0
  37. data/lib/active_model/serializer/adapter/json.rb +2 -0
  38. data/lib/active_model/serializer/adapter/json_api.rb +2 -0
  39. data/lib/active_model/serializer/adapter/null.rb +2 -0
  40. data/lib/active_model/serializer/adapter.rb +2 -0
  41. data/lib/active_model/serializer/array_serializer.rb +10 -5
  42. data/lib/active_model/serializer/association.rb +64 -10
  43. data/lib/active_model/serializer/attribute.rb +2 -0
  44. data/lib/active_model/serializer/belongs_to_reflection.rb +6 -3
  45. data/lib/active_model/serializer/collection_serializer.rb +39 -13
  46. data/lib/active_model/serializer/{caching.rb → concerns/caching.rb} +87 -116
  47. data/lib/active_model/serializer/error_serializer.rb +13 -7
  48. data/lib/active_model/serializer/errors_serializer.rb +27 -20
  49. data/lib/active_model/serializer/field.rb +2 -0
  50. data/lib/active_model/serializer/fieldset.rb +2 -0
  51. data/lib/active_model/serializer/has_many_reflection.rb +5 -3
  52. data/lib/active_model/serializer/has_one_reflection.rb +3 -4
  53. data/lib/active_model/serializer/lazy_association.rb +99 -0
  54. data/lib/active_model/serializer/link.rb +23 -0
  55. data/lib/active_model/serializer/lint.rb +136 -130
  56. data/lib/active_model/serializer/null.rb +2 -0
  57. data/lib/active_model/serializer/reflection.rb +132 -67
  58. data/lib/active_model/serializer/version.rb +3 -1
  59. data/lib/active_model/serializer.rb +308 -82
  60. data/lib/active_model_serializers/adapter/attributes.rb +5 -66
  61. data/lib/active_model_serializers/adapter/base.rb +41 -39
  62. data/lib/active_model_serializers/adapter/json.rb +2 -0
  63. data/lib/active_model_serializers/adapter/json_api/deserialization.rb +4 -2
  64. data/lib/active_model_serializers/adapter/json_api/error.rb +2 -0
  65. data/lib/active_model_serializers/adapter/json_api/jsonapi.rb +2 -0
  66. data/lib/active_model_serializers/adapter/json_api/link.rb +3 -1
  67. data/lib/active_model_serializers/adapter/json_api/meta.rb +2 -0
  68. data/lib/active_model_serializers/adapter/json_api/pagination_links.rb +49 -21
  69. data/lib/active_model_serializers/adapter/json_api/relationship.rb +77 -23
  70. data/lib/active_model_serializers/adapter/json_api/resource_identifier.rb +41 -10
  71. data/lib/active_model_serializers/adapter/json_api.rb +84 -65
  72. data/lib/active_model_serializers/adapter/null.rb +2 -0
  73. data/lib/active_model_serializers/adapter.rb +9 -1
  74. data/lib/active_model_serializers/callbacks.rb +2 -0
  75. data/lib/active_model_serializers/deprecate.rb +3 -2
  76. data/lib/active_model_serializers/deserialization.rb +4 -0
  77. data/lib/active_model_serializers/json_pointer.rb +2 -0
  78. data/lib/active_model_serializers/logging.rb +2 -0
  79. data/lib/active_model_serializers/lookup_chain.rb +82 -0
  80. data/lib/active_model_serializers/model.rb +111 -28
  81. data/lib/active_model_serializers/railtie.rb +7 -1
  82. data/lib/active_model_serializers/register_jsonapi_renderer.rb +46 -31
  83. data/lib/active_model_serializers/serializable_resource.rb +10 -7
  84. data/lib/active_model_serializers/serialization_context.rb +12 -3
  85. data/lib/active_model_serializers/test/schema.rb +4 -2
  86. data/lib/active_model_serializers/test/serializer.rb +2 -0
  87. data/lib/active_model_serializers/test.rb +2 -0
  88. data/lib/active_model_serializers.rb +35 -10
  89. data/lib/generators/rails/resource_override.rb +3 -1
  90. data/lib/generators/rails/serializer_generator.rb +6 -4
  91. data/lib/grape/active_model_serializers.rb +9 -5
  92. data/lib/grape/formatters/active_model_serializers.rb +21 -2
  93. data/lib/grape/helpers/active_model_serializers.rb +3 -0
  94. data/lib/tasks/rubocop.rake +55 -0
  95. data/test/action_controller/adapter_selector_test.rb +16 -5
  96. data/test/action_controller/explicit_serializer_test.rb +7 -4
  97. data/test/action_controller/json/include_test.rb +108 -27
  98. data/test/action_controller/json_api/deserialization_test.rb +3 -1
  99. data/test/action_controller/json_api/errors_test.rb +10 -9
  100. data/test/action_controller/json_api/fields_test.rb +68 -0
  101. data/test/action_controller/json_api/linked_test.rb +31 -24
  102. data/test/action_controller/json_api/pagination_test.rb +33 -23
  103. data/test/action_controller/json_api/transform_test.rb +13 -3
  104. data/test/action_controller/lookup_proc_test.rb +51 -0
  105. data/test/action_controller/namespace_lookup_test.rb +234 -0
  106. data/test/action_controller/serialization_scope_name_test.rb +14 -6
  107. data/test/action_controller/serialization_test.rb +23 -12
  108. data/test/active_model_serializers/adapter_for_test.rb +2 -0
  109. data/test/active_model_serializers/json_pointer_test.rb +17 -13
  110. data/test/active_model_serializers/logging_test.rb +2 -0
  111. data/test/active_model_serializers/model_test.rb +139 -4
  112. data/test/active_model_serializers/railtie_test_isolated.rb +14 -7
  113. data/test/active_model_serializers/register_jsonapi_renderer_test_isolated.rb +163 -0
  114. data/test/active_model_serializers/serialization_context_test_isolated.rb +25 -10
  115. data/test/active_model_serializers/test/schema_test.rb +5 -2
  116. data/test/active_model_serializers/test/serializer_test.rb +2 -0
  117. data/test/active_record_test.rb +2 -0
  118. data/test/adapter/attributes_test.rb +42 -0
  119. data/test/adapter/deprecation_test.rb +2 -0
  120. data/test/adapter/json/belongs_to_test.rb +2 -0
  121. data/test/adapter/json/collection_test.rb +16 -0
  122. data/test/adapter/json/has_many_test.rb +12 -2
  123. data/test/adapter/json/transform_test.rb +17 -15
  124. data/test/adapter/json_api/belongs_to_test.rb +2 -0
  125. data/test/adapter/json_api/collection_test.rb +6 -3
  126. data/test/adapter/json_api/errors_test.rb +19 -19
  127. data/test/adapter/json_api/fields_test.rb +14 -3
  128. data/test/adapter/json_api/has_many_explicit_serializer_test.rb +2 -0
  129. data/test/adapter/json_api/has_many_test.rb +51 -20
  130. data/test/adapter/json_api/has_one_test.rb +2 -0
  131. data/test/adapter/json_api/include_data_if_sideloaded_test.rb +215 -0
  132. data/test/adapter/json_api/json_api_test.rb +7 -7
  133. data/test/adapter/json_api/linked_test.rb +35 -12
  134. data/test/adapter/json_api/links_test.rb +22 -3
  135. data/test/adapter/json_api/pagination_links_test.rb +55 -13
  136. data/test/adapter/json_api/parse_test.rb +3 -1
  137. data/test/adapter/json_api/relationship_test.rb +311 -73
  138. data/test/adapter/json_api/resource_meta_test.rb +5 -3
  139. data/test/adapter/json_api/toplevel_jsonapi_test.rb +2 -0
  140. data/test/adapter/json_api/transform_test.rb +265 -253
  141. data/test/adapter/json_api/type_test.rb +170 -36
  142. data/test/adapter/json_test.rb +10 -7
  143. data/test/adapter/null_test.rb +3 -2
  144. data/test/adapter/polymorphic_test.rb +54 -5
  145. data/test/adapter_test.rb +3 -1
  146. data/test/array_serializer_test.rb +2 -0
  147. data/test/benchmark/app.rb +3 -1
  148. data/test/benchmark/benchmarking_support.rb +3 -1
  149. data/test/benchmark/bm_active_record.rb +83 -0
  150. data/test/benchmark/bm_adapter.rb +40 -0
  151. data/test/benchmark/bm_caching.rb +18 -16
  152. data/test/benchmark/bm_lookup_chain.rb +85 -0
  153. data/test/benchmark/bm_transform.rb +23 -10
  154. data/test/benchmark/controllers.rb +18 -17
  155. data/test/benchmark/fixtures.rb +74 -72
  156. data/test/cache_test.rb +301 -69
  157. data/test/collection_serializer_test.rb +33 -14
  158. data/test/fixtures/active_record.rb +47 -10
  159. data/test/fixtures/poro.rb +128 -183
  160. data/test/generators/scaffold_controller_generator_test.rb +2 -0
  161. data/test/generators/serializer_generator_test.rb +25 -5
  162. data/test/grape_test.rb +172 -56
  163. data/test/lint_test.rb +3 -1
  164. data/test/logger_test.rb +15 -11
  165. data/test/poro_test.rb +2 -0
  166. data/test/serializable_resource_test.rb +20 -22
  167. data/test/serializers/association_macros_test.rb +5 -2
  168. data/test/serializers/associations_test.rb +274 -49
  169. data/test/serializers/attribute_test.rb +7 -3
  170. data/test/serializers/attributes_test.rb +3 -1
  171. data/test/serializers/caching_configuration_test_isolated.rb +8 -6
  172. data/test/serializers/configuration_test.rb +2 -0
  173. data/test/serializers/fieldset_test.rb +3 -1
  174. data/test/serializers/meta_test.rb +14 -6
  175. data/test/serializers/options_test.rb +19 -6
  176. data/test/serializers/read_attribute_for_serialization_test.rb +5 -3
  177. data/test/serializers/reflection_test.rb +481 -0
  178. data/test/serializers/root_test.rb +3 -1
  179. data/test/serializers/serialization_test.rb +4 -2
  180. data/test/serializers/serializer_for_test.rb +14 -10
  181. data/test/serializers/serializer_for_with_namespace_test.rb +90 -0
  182. data/test/support/isolated_unit.rb +11 -4
  183. data/test/support/rails5_shims.rb +10 -2
  184. data/test/support/rails_app.rb +4 -9
  185. data/test/support/serialization_testing.rb +33 -5
  186. data/test/test_helper.rb +15 -0
  187. metadata +126 -46
  188. data/.rubocop_todo.yml +0 -167
  189. data/docs/ARCHITECTURE.md +0 -126
  190. data/lib/active_model/serializer/associations.rb +0 -100
  191. data/lib/active_model/serializer/attributes.rb +0 -82
  192. data/lib/active_model/serializer/collection_reflection.rb +0 -7
  193. data/lib/active_model/serializer/configuration.rb +0 -35
  194. data/lib/active_model/serializer/include_tree.rb +0 -111
  195. data/lib/active_model/serializer/links.rb +0 -35
  196. data/lib/active_model/serializer/meta.rb +0 -29
  197. data/lib/active_model/serializer/singular_reflection.rb +0 -7
  198. data/lib/active_model/serializer/type.rb +0 -25
  199. data/lib/active_model_serializers/key_transform.rb +0 -70
  200. data/test/active_model_serializers/key_transform_test.rb +0 -263
  201. data/test/adapter/json_api/has_many_embed_ids_test.rb +0 -43
  202. data/test/adapter/json_api/relationships_test.rb +0 -199
  203. data/test/adapter/json_api/resource_identifier_test.rb +0 -85
  204. data/test/include_tree/from_include_args_test.rb +0 -26
  205. data/test/include_tree/from_string_test.rb +0 -94
  206. data/test/include_tree/include_args_to_hash_test.rb +0 -64
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_model_serializers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Klabnik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-17 00:00:00.000000000 Z
11
+ date: 2019-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -16,56 +16,134 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4.0'
19
+ version: '4.1'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '6'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
27
  - - ">="
25
28
  - !ruby/object:Gem::Version
26
- version: '4.0'
29
+ version: '4.1'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '6'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: actionpack
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
37
  - - ">="
32
38
  - !ruby/object:Gem::Version
33
- version: '4.0'
39
+ version: '4.1'
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '6'
34
43
  type: :runtime
35
44
  prerelease: false
36
45
  version_requirements: !ruby/object:Gem::Requirement
37
46
  requirements:
38
47
  - - ">="
39
48
  - !ruby/object:Gem::Version
40
- version: '4.0'
49
+ version: '4.1'
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '6'
41
53
  - !ruby/object:Gem::Dependency
42
54
  name: railties
43
55
  requirement: !ruby/object:Gem::Requirement
44
56
  requirements:
45
57
  - - ">="
46
58
  - !ruby/object:Gem::Version
47
- version: '4.0'
59
+ version: '4.1'
60
+ - - "<"
61
+ - !ruby/object:Gem::Version
62
+ version: '6'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '4.1'
70
+ - - "<"
71
+ - !ruby/object:Gem::Version
72
+ version: '6'
73
+ - !ruby/object:Gem::Dependency
74
+ name: minitest
75
+ requirement: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - "~>"
78
+ - !ruby/object:Gem::Version
79
+ version: '5.0'
80
+ - - "<"
81
+ - !ruby/object:Gem::Version
82
+ version: '5.11'
83
+ type: :development
84
+ prerelease: false
85
+ version_requirements: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '5.0'
90
+ - - "<"
91
+ - !ruby/object:Gem::Version
92
+ version: '5.11'
93
+ - !ruby/object:Gem::Dependency
94
+ name: jsonapi-renderer
95
+ requirement: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: 0.1.1.beta1
100
+ - - "<"
101
+ - !ruby/object:Gem::Version
102
+ version: '0.3'
103
+ type: :runtime
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: 0.1.1.beta1
110
+ - - "<"
111
+ - !ruby/object:Gem::Version
112
+ version: '0.3'
113
+ - !ruby/object:Gem::Dependency
114
+ name: case_transform
115
+ requirement: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: '0.2'
48
120
  type: :runtime
49
121
  prerelease: false
50
122
  version_requirements: !ruby/object:Gem::Requirement
51
123
  requirements:
52
124
  - - ">="
53
125
  - !ruby/object:Gem::Version
54
- version: '4.0'
126
+ version: '0.2'
55
127
  - !ruby/object:Gem::Dependency
56
128
  name: activerecord
57
129
  requirement: !ruby/object:Gem::Requirement
58
130
  requirements:
59
131
  - - ">="
60
132
  - !ruby/object:Gem::Version
61
- version: '4.0'
133
+ version: '4.1'
134
+ - - "<"
135
+ - !ruby/object:Gem::Version
136
+ version: '6'
62
137
  type: :development
63
138
  prerelease: false
64
139
  version_requirements: !ruby/object:Gem::Requirement
65
140
  requirements:
66
141
  - - ">="
67
142
  - !ruby/object:Gem::Version
68
- version: '4.0'
143
+ version: '4.1'
144
+ - - "<"
145
+ - !ruby/object:Gem::Version
146
+ version: '6'
69
147
  - !ruby/object:Gem::Dependency
70
148
  name: kaminari
71
149
  requirement: !ruby/object:Gem::Requirement
@@ -151,7 +229,7 @@ dependencies:
151
229
  version: '0.13'
152
230
  - - "<"
153
231
  - !ruby/object:Gem::Version
154
- version: '1.0'
232
+ version: 0.19.1
155
233
  type: :development
156
234
  prerelease: false
157
235
  version_requirements: !ruby/object:Gem::Requirement
@@ -161,7 +239,7 @@ dependencies:
161
239
  version: '0.13'
162
240
  - - "<"
163
241
  - !ruby/object:Gem::Version
164
- version: '1.0'
242
+ version: 0.19.1
165
243
  - !ruby/object:Gem::Dependency
166
244
  name: json_schema
167
245
  requirement: !ruby/object:Gem::Requirement
@@ -208,10 +286,10 @@ files:
208
286
  - ".github/PULL_REQUEST_TEMPLATE.md"
209
287
  - ".gitignore"
210
288
  - ".rubocop.yml"
211
- - ".rubocop_todo.yml"
212
289
  - ".simplecov"
213
290
  - ".travis.yml"
214
291
  - CHANGELOG.md
292
+ - CODE_OF_CONDUCT.md
215
293
  - CONTRIBUTING.md
216
294
  - Gemfile
217
295
  - MIT-LICENSE
@@ -221,14 +299,15 @@ files:
221
299
  - appveyor.yml
222
300
  - bin/bench
223
301
  - bin/bench_regression
302
+ - bin/rubocop
224
303
  - bin/serve_benchmark
225
- - docs/ARCHITECTURE.md
226
304
  - docs/README.md
227
305
  - docs/STYLE.md
228
306
  - docs/general/adapters.md
229
307
  - docs/general/caching.md
230
308
  - docs/general/configuration_options.md
231
309
  - docs/general/deserialization.md
310
+ - docs/general/fields.md
232
311
  - docs/general/getting_started.md
233
312
  - docs/general/instrumentation.md
234
313
  - docs/general/key_transforms.md
@@ -237,11 +316,14 @@ files:
237
316
  - docs/general/serializers.md
238
317
  - docs/how-open-source-maintained.jpg
239
318
  - docs/howto/add_pagination_links.md
319
+ - docs/howto/add_relationship_links.md
240
320
  - docs/howto/add_root_key.md
321
+ - docs/howto/grape_integration.md
241
322
  - docs/howto/outside_controller_use.md
242
323
  - docs/howto/passing_arbitrary_options.md
243
324
  - docs/howto/serialize_poro.md
244
325
  - docs/howto/test.md
326
+ - docs/howto/upgrade_from_0_8_to_0_10.md
245
327
  - docs/integrations/ember-and-json-api.md
246
328
  - docs/integrations/grape.md
247
329
  - docs/jsonapi/errors.md
@@ -260,28 +342,21 @@ files:
260
342
  - lib/active_model/serializer/adapter/null.rb
261
343
  - lib/active_model/serializer/array_serializer.rb
262
344
  - lib/active_model/serializer/association.rb
263
- - lib/active_model/serializer/associations.rb
264
345
  - lib/active_model/serializer/attribute.rb
265
- - lib/active_model/serializer/attributes.rb
266
346
  - lib/active_model/serializer/belongs_to_reflection.rb
267
- - lib/active_model/serializer/caching.rb
268
- - lib/active_model/serializer/collection_reflection.rb
269
347
  - lib/active_model/serializer/collection_serializer.rb
270
- - lib/active_model/serializer/configuration.rb
348
+ - lib/active_model/serializer/concerns/caching.rb
271
349
  - lib/active_model/serializer/error_serializer.rb
272
350
  - lib/active_model/serializer/errors_serializer.rb
273
351
  - lib/active_model/serializer/field.rb
274
352
  - lib/active_model/serializer/fieldset.rb
275
353
  - lib/active_model/serializer/has_many_reflection.rb
276
354
  - lib/active_model/serializer/has_one_reflection.rb
277
- - lib/active_model/serializer/include_tree.rb
278
- - lib/active_model/serializer/links.rb
355
+ - lib/active_model/serializer/lazy_association.rb
356
+ - lib/active_model/serializer/link.rb
279
357
  - lib/active_model/serializer/lint.rb
280
- - lib/active_model/serializer/meta.rb
281
358
  - lib/active_model/serializer/null.rb
282
359
  - lib/active_model/serializer/reflection.rb
283
- - lib/active_model/serializer/singular_reflection.rb
284
- - lib/active_model/serializer/type.rb
285
360
  - lib/active_model/serializer/version.rb
286
361
  - lib/active_model_serializers.rb
287
362
  - lib/active_model_serializers/adapter.rb
@@ -302,8 +377,8 @@ files:
302
377
  - lib/active_model_serializers/deprecate.rb
303
378
  - lib/active_model_serializers/deserialization.rb
304
379
  - lib/active_model_serializers/json_pointer.rb
305
- - lib/active_model_serializers/key_transform.rb
306
380
  - lib/active_model_serializers/logging.rb
381
+ - lib/active_model_serializers/lookup_chain.rb
307
382
  - lib/active_model_serializers/model.rb
308
383
  - lib/active_model_serializers/railtie.rb
309
384
  - lib/active_model_serializers/register_jsonapi_renderer.rb
@@ -319,26 +394,31 @@ files:
319
394
  - lib/grape/active_model_serializers.rb
320
395
  - lib/grape/formatters/active_model_serializers.rb
321
396
  - lib/grape/helpers/active_model_serializers.rb
397
+ - lib/tasks/rubocop.rake
322
398
  - test/action_controller/adapter_selector_test.rb
323
399
  - test/action_controller/explicit_serializer_test.rb
324
400
  - test/action_controller/json/include_test.rb
325
401
  - test/action_controller/json_api/deserialization_test.rb
326
402
  - test/action_controller/json_api/errors_test.rb
403
+ - test/action_controller/json_api/fields_test.rb
327
404
  - test/action_controller/json_api/linked_test.rb
328
405
  - test/action_controller/json_api/pagination_test.rb
329
406
  - test/action_controller/json_api/transform_test.rb
407
+ - test/action_controller/lookup_proc_test.rb
408
+ - test/action_controller/namespace_lookup_test.rb
330
409
  - test/action_controller/serialization_scope_name_test.rb
331
410
  - test/action_controller/serialization_test.rb
332
411
  - test/active_model_serializers/adapter_for_test.rb
333
412
  - test/active_model_serializers/json_pointer_test.rb
334
- - test/active_model_serializers/key_transform_test.rb
335
413
  - test/active_model_serializers/logging_test.rb
336
414
  - test/active_model_serializers/model_test.rb
337
415
  - test/active_model_serializers/railtie_test_isolated.rb
416
+ - test/active_model_serializers/register_jsonapi_renderer_test_isolated.rb
338
417
  - test/active_model_serializers/serialization_context_test_isolated.rb
339
418
  - test/active_model_serializers/test/schema_test.rb
340
419
  - test/active_model_serializers/test/serializer_test.rb
341
420
  - test/active_record_test.rb
421
+ - test/adapter/attributes_test.rb
342
422
  - test/adapter/deprecation_test.rb
343
423
  - test/adapter/json/belongs_to_test.rb
344
424
  - test/adapter/json/collection_test.rb
@@ -348,18 +428,16 @@ files:
348
428
  - test/adapter/json_api/collection_test.rb
349
429
  - test/adapter/json_api/errors_test.rb
350
430
  - test/adapter/json_api/fields_test.rb
351
- - test/adapter/json_api/has_many_embed_ids_test.rb
352
431
  - test/adapter/json_api/has_many_explicit_serializer_test.rb
353
432
  - test/adapter/json_api/has_many_test.rb
354
433
  - test/adapter/json_api/has_one_test.rb
434
+ - test/adapter/json_api/include_data_if_sideloaded_test.rb
355
435
  - test/adapter/json_api/json_api_test.rb
356
436
  - test/adapter/json_api/linked_test.rb
357
437
  - test/adapter/json_api/links_test.rb
358
438
  - test/adapter/json_api/pagination_links_test.rb
359
439
  - test/adapter/json_api/parse_test.rb
360
440
  - test/adapter/json_api/relationship_test.rb
361
- - test/adapter/json_api/relationships_test.rb
362
- - test/adapter/json_api/resource_identifier_test.rb
363
441
  - test/adapter/json_api/resource_meta_test.rb
364
442
  - test/adapter/json_api/toplevel_jsonapi_test.rb
365
443
  - test/adapter/json_api/transform_test.rb
@@ -371,7 +449,10 @@ files:
371
449
  - test/array_serializer_test.rb
372
450
  - test/benchmark/app.rb
373
451
  - test/benchmark/benchmarking_support.rb
452
+ - test/benchmark/bm_active_record.rb
453
+ - test/benchmark/bm_adapter.rb
374
454
  - test/benchmark/bm_caching.rb
455
+ - test/benchmark/bm_lookup_chain.rb
375
456
  - test/benchmark/bm_transform.rb
376
457
  - test/benchmark/config.ru
377
458
  - test/benchmark/controllers.rb
@@ -383,9 +464,6 @@ files:
383
464
  - test/generators/scaffold_controller_generator_test.rb
384
465
  - test/generators/serializer_generator_test.rb
385
466
  - test/grape_test.rb
386
- - test/include_tree/from_include_args_test.rb
387
- - test/include_tree/from_string_test.rb
388
- - test/include_tree/include_args_to_hash_test.rb
389
467
  - test/lint_test.rb
390
468
  - test/logger_test.rb
391
469
  - test/poro_test.rb
@@ -400,9 +478,11 @@ files:
400
478
  - test/serializers/meta_test.rb
401
479
  - test/serializers/options_test.rb
402
480
  - test/serializers/read_attribute_for_serialization_test.rb
481
+ - test/serializers/reflection_test.rb
403
482
  - test/serializers/root_test.rb
404
483
  - test/serializers/serialization_test.rb
405
484
  - test/serializers/serializer_for_test.rb
485
+ - test/serializers/serializer_for_with_namespace_test.rb
406
486
  - test/support/custom_schemas/active_model_serializers/test/schema_test/my/index.json
407
487
  - test/support/isolated_unit.rb
408
488
  - test/support/rails5_shims.rb
@@ -419,10 +499,7 @@ homepage: https://github.com/rails-api/active_model_serializers
419
499
  licenses:
420
500
  - MIT
421
501
  metadata: {}
422
- post_install_message: |
423
- NOTE: The default key case for the JsonApi adapter has changed to dashed.
424
- See https://github.com/rails-api/active_model_serializers/blob/master/docs/general/key_transforms.md
425
- for more information on configuring this behavior.
502
+ post_install_message:
426
503
  rdoc_options: []
427
504
  require_paths:
428
505
  - lib
@@ -430,7 +507,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
430
507
  requirements:
431
508
  - - ">="
432
509
  - !ruby/object:Gem::Version
433
- version: 2.0.0
510
+ version: '2.1'
434
511
  required_rubygems_version: !ruby/object:Gem::Requirement
435
512
  requirements:
436
513
  - - ">="
@@ -438,7 +515,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
438
515
  version: '0'
439
516
  requirements: []
440
517
  rubyforge_project:
441
- rubygems_version: 2.4.5
518
+ rubygems_version: 2.7.6
442
519
  signing_key:
443
520
  specification_version: 4
444
521
  summary: Conventions-based JSON generation for Rails.
@@ -448,21 +525,25 @@ test_files:
448
525
  - test/action_controller/json/include_test.rb
449
526
  - test/action_controller/json_api/deserialization_test.rb
450
527
  - test/action_controller/json_api/errors_test.rb
528
+ - test/action_controller/json_api/fields_test.rb
451
529
  - test/action_controller/json_api/linked_test.rb
452
530
  - test/action_controller/json_api/pagination_test.rb
453
531
  - test/action_controller/json_api/transform_test.rb
532
+ - test/action_controller/lookup_proc_test.rb
533
+ - test/action_controller/namespace_lookup_test.rb
454
534
  - test/action_controller/serialization_scope_name_test.rb
455
535
  - test/action_controller/serialization_test.rb
456
536
  - test/active_model_serializers/adapter_for_test.rb
457
537
  - test/active_model_serializers/json_pointer_test.rb
458
- - test/active_model_serializers/key_transform_test.rb
459
538
  - test/active_model_serializers/logging_test.rb
460
539
  - test/active_model_serializers/model_test.rb
461
540
  - test/active_model_serializers/railtie_test_isolated.rb
541
+ - test/active_model_serializers/register_jsonapi_renderer_test_isolated.rb
462
542
  - test/active_model_serializers/serialization_context_test_isolated.rb
463
543
  - test/active_model_serializers/test/schema_test.rb
464
544
  - test/active_model_serializers/test/serializer_test.rb
465
545
  - test/active_record_test.rb
546
+ - test/adapter/attributes_test.rb
466
547
  - test/adapter/deprecation_test.rb
467
548
  - test/adapter/json/belongs_to_test.rb
468
549
  - test/adapter/json/collection_test.rb
@@ -472,18 +553,16 @@ test_files:
472
553
  - test/adapter/json_api/collection_test.rb
473
554
  - test/adapter/json_api/errors_test.rb
474
555
  - test/adapter/json_api/fields_test.rb
475
- - test/adapter/json_api/has_many_embed_ids_test.rb
476
556
  - test/adapter/json_api/has_many_explicit_serializer_test.rb
477
557
  - test/adapter/json_api/has_many_test.rb
478
558
  - test/adapter/json_api/has_one_test.rb
559
+ - test/adapter/json_api/include_data_if_sideloaded_test.rb
479
560
  - test/adapter/json_api/json_api_test.rb
480
561
  - test/adapter/json_api/linked_test.rb
481
562
  - test/adapter/json_api/links_test.rb
482
563
  - test/adapter/json_api/pagination_links_test.rb
483
564
  - test/adapter/json_api/parse_test.rb
484
565
  - test/adapter/json_api/relationship_test.rb
485
- - test/adapter/json_api/relationships_test.rb
486
- - test/adapter/json_api/resource_identifier_test.rb
487
566
  - test/adapter/json_api/resource_meta_test.rb
488
567
  - test/adapter/json_api/toplevel_jsonapi_test.rb
489
568
  - test/adapter/json_api/transform_test.rb
@@ -495,7 +574,10 @@ test_files:
495
574
  - test/array_serializer_test.rb
496
575
  - test/benchmark/app.rb
497
576
  - test/benchmark/benchmarking_support.rb
577
+ - test/benchmark/bm_active_record.rb
578
+ - test/benchmark/bm_adapter.rb
498
579
  - test/benchmark/bm_caching.rb
580
+ - test/benchmark/bm_lookup_chain.rb
499
581
  - test/benchmark/bm_transform.rb
500
582
  - test/benchmark/config.ru
501
583
  - test/benchmark/controllers.rb
@@ -507,9 +589,6 @@ test_files:
507
589
  - test/generators/scaffold_controller_generator_test.rb
508
590
  - test/generators/serializer_generator_test.rb
509
591
  - test/grape_test.rb
510
- - test/include_tree/from_include_args_test.rb
511
- - test/include_tree/from_string_test.rb
512
- - test/include_tree/include_args_to_hash_test.rb
513
592
  - test/lint_test.rb
514
593
  - test/logger_test.rb
515
594
  - test/poro_test.rb
@@ -524,9 +603,11 @@ test_files:
524
603
  - test/serializers/meta_test.rb
525
604
  - test/serializers/options_test.rb
526
605
  - test/serializers/read_attribute_for_serialization_test.rb
606
+ - test/serializers/reflection_test.rb
527
607
  - test/serializers/root_test.rb
528
608
  - test/serializers/serialization_test.rb
529
609
  - test/serializers/serializer_for_test.rb
610
+ - test/serializers/serializer_for_with_namespace_test.rb
530
611
  - test/support/custom_schemas/active_model_serializers/test/schema_test/my/index.json
531
612
  - test/support/isolated_unit.rb
532
613
  - test/support/rails5_shims.rb
@@ -539,4 +620,3 @@ test_files:
539
620
  - test/support/schemas/simple_json_pointers.json
540
621
  - test/support/serialization_testing.rb
541
622
  - test/test_helper.rb
542
- has_rdoc:
data/.rubocop_todo.yml DELETED
@@ -1,167 +0,0 @@
1
- # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2016-03-08 22:29:52 +0100 using RuboCop version 0.37.2.
4
- # The point is for the user to remove these configuration records
5
- # one by one as the offenses are removed from the code base.
6
- # Note that changes in the inspected code, or installation of new
7
- # versions of RuboCop, may require this file to be generated again.
8
-
9
- # Offense count: 2
10
- Lint/HandleExceptions:
11
- Exclude:
12
- - 'Rakefile'
13
-
14
- # Offense count: 2
15
- # Cop supports --auto-correct.
16
- # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods.
17
- Lint/UnusedMethodArgument:
18
- Exclude:
19
- - 'test/lint_test.rb'
20
-
21
- # Offense count: 4
22
- # Configuration parameters: EnforcedStyle, SupportedStyles.
23
- # SupportedStyles: strict, flexible
24
- Rails/TimeZone:
25
- Exclude:
26
- - 'test/action_controller/serialization_test.rb'
27
- - 'test/serializers/cache_test.rb'
28
-
29
- # Offense count: 16
30
- # Cop supports --auto-correct.
31
- # Configuration parameters: EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle, SupportedLastArgumentHashStyles.
32
- # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
33
- Style/AlignHash:
34
- Exclude:
35
- - 'test/action_controller/json_api/pagination_test.rb'
36
-
37
- # Offense count: 27
38
- # Cop supports --auto-correct.
39
- # Configuration parameters: EnforcedStyle, SupportedStyles.
40
- # SupportedStyles: braces, no_braces, context_dependent
41
- Style/BracesAroundHashParameters:
42
- Exclude:
43
- - 'test/action_controller/adapter_selector_test.rb'
44
- - 'test/action_controller/json_api/pagination_test.rb'
45
- - 'test/adapter/json_api/linked_test.rb'
46
- - 'test/adapter/json_api/pagination_links_test.rb'
47
- - 'test/adapter/null_test.rb'
48
- - 'test/adapter_test.rb'
49
- - 'test/collection_serializer_test.rb'
50
- - 'test/serializable_resource_test.rb'
51
- - 'test/serializers/associations_test.rb'
52
- - 'test/serializers/attributes_test.rb'
53
- - 'test/serializers/root_test.rb'
54
-
55
- # Offense count: 271
56
- # Configuration parameters: EnforcedStyle, SupportedStyles.
57
- # SupportedStyles: nested, compact
58
- Style/ClassAndModuleChildren:
59
- Enabled: false
60
-
61
- # Offense count: 6
62
- # Cop supports --auto-correct.
63
- Style/CommentIndentation:
64
- Exclude:
65
- - 'active_model_serializers.gemspec'
66
-
67
- # Offense count: 1
68
- Style/DoubleNegation:
69
- Exclude:
70
- - 'lib/active_model/serializable_resource.rb'
71
-
72
- # Offense count: 1
73
- # Configuration parameters: MinBodyLength.
74
- Style/GuardClause:
75
- Exclude:
76
- - 'lib/active_model/serializer.rb'
77
-
78
- # Offense count: 58
79
- # Cop supports --auto-correct.
80
- # Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues.
81
- # SupportedStyles: ruby19, ruby19_no_mixed_keys, hash_rockets
82
- Style/HashSyntax:
83
- Enabled: false
84
-
85
- # Offense count: 4
86
- # Cop supports --auto-correct.
87
- # Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
88
- # SupportedStyles: special_inside_parentheses, consistent, align_brackets
89
- Style/IndentArray:
90
- Enabled: false
91
-
92
- # Offense count: 10
93
- # Cop supports --auto-correct.
94
- # Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
95
- # SupportedStyles: special_inside_parentheses, consistent, align_braces
96
- Style/IndentHash:
97
- Enabled: false
98
-
99
- # Offense count: 1
100
- # Cop supports --auto-correct.
101
- Style/Lambda:
102
- Exclude:
103
- - 'lib/active_model/serializer.rb'
104
-
105
- # Offense count: 1
106
- # Cop supports --auto-correct.
107
- # Configuration parameters: EnforcedStyle, SupportedStyles.
108
- # SupportedStyles: require_parentheses, require_no_parentheses, require_no_parentheses_except_multiline
109
- Style/MethodDefParentheses:
110
- Enabled: false
111
-
112
- # Offense count: 1
113
- # Cop supports --auto-correct.
114
- # Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
115
- # SupportedStyles: aligned, indented
116
- Style/MultilineOperationIndentation:
117
- Enabled: false
118
-
119
- # Offense count: 1
120
- # Cop supports --auto-correct.
121
- Style/NegatedIf:
122
- Exclude:
123
- - 'lib/action_controller/serialization.rb'
124
-
125
- # Offense count: 1
126
- # Cop supports --auto-correct.
127
- Style/PerlBackrefs:
128
- Exclude:
129
- - 'test/fixtures/poro.rb'
130
-
131
- # Offense count: 3
132
- # Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
133
- # NamePrefix: is_, has_, have_
134
- # NamePrefixBlacklist: is_, has_, have_
135
- # NameWhitelist: is_a?
136
- Style/PredicateName:
137
- Exclude:
138
- - 'lib/active_model/serializer/associations.rb'
139
- - 'test/action_controller/json_api/linked_test.rb'
140
-
141
- # Offense count: 1
142
- # Cop supports --auto-correct.
143
- Style/RedundantSelf:
144
- Exclude:
145
- - 'test/fixtures/poro.rb'
146
-
147
- # Offense count: 1
148
- # Cop supports --auto-correct.
149
- # Configuration parameters: AllowIfMethodIsEmpty.
150
- Style/SingleLineMethods:
151
- Exclude:
152
- - 'test/serializers/serializer_for_test.rb'
153
-
154
- # Offense count: 4
155
- # Cop supports --auto-correct.
156
- # Configuration parameters: EnforcedStyle, SupportedStyles.
157
- # SupportedStyles: single_quotes, double_quotes
158
- Style/StringLiteralsInInterpolation:
159
- Enabled: false
160
-
161
- # Offense count: 1
162
- # Cop supports --auto-correct.
163
- # Configuration parameters: EnforcedStyle, SupportedStyles.
164
- # SupportedStyles: final_newline, final_blank_line
165
- Style/TrailingBlankLines:
166
- Exclude:
167
- - 'test/adapter/null_test.rb'