active_model_serializers 0.8.3 → 0.10.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (235) hide show
  1. checksums.yaml +5 -5
  2. data/.github/ISSUE_TEMPLATE.md +29 -0
  3. data/.github/PULL_REQUEST_TEMPLATE.md +15 -0
  4. data/.gitignore +17 -0
  5. data/.rubocop.yml +105 -0
  6. data/.simplecov +110 -0
  7. data/.travis.yml +50 -24
  8. data/CHANGELOG.md +650 -6
  9. data/CODE_OF_CONDUCT.md +74 -0
  10. data/CONTRIBUTING.md +105 -0
  11. data/Gemfile +69 -1
  12. data/{MIT-LICENSE.txt → MIT-LICENSE} +3 -2
  13. data/README.md +195 -545
  14. data/Rakefile +64 -8
  15. data/active_model_serializers.gemspec +62 -23
  16. data/appveyor.yml +28 -0
  17. data/bin/bench +171 -0
  18. data/bin/bench_regression +316 -0
  19. data/bin/rubocop +38 -0
  20. data/bin/serve_benchmark +39 -0
  21. data/docs/README.md +41 -0
  22. data/docs/STYLE.md +58 -0
  23. data/docs/general/adapters.md +269 -0
  24. data/docs/general/caching.md +58 -0
  25. data/docs/general/configuration_options.md +185 -0
  26. data/docs/general/deserialization.md +100 -0
  27. data/docs/general/fields.md +31 -0
  28. data/docs/general/getting_started.md +133 -0
  29. data/docs/general/instrumentation.md +40 -0
  30. data/docs/general/key_transforms.md +40 -0
  31. data/docs/general/logging.md +21 -0
  32. data/docs/general/rendering.md +293 -0
  33. data/docs/general/serializers.md +495 -0
  34. data/docs/how-open-source-maintained.jpg +0 -0
  35. data/docs/howto/add_pagination_links.md +138 -0
  36. data/docs/howto/add_relationship_links.md +140 -0
  37. data/docs/howto/add_root_key.md +62 -0
  38. data/docs/howto/grape_integration.md +42 -0
  39. data/docs/howto/outside_controller_use.md +66 -0
  40. data/docs/howto/passing_arbitrary_options.md +27 -0
  41. data/docs/howto/serialize_poro.md +73 -0
  42. data/docs/howto/test.md +154 -0
  43. data/docs/howto/upgrade_from_0_8_to_0_10.md +265 -0
  44. data/docs/integrations/ember-and-json-api.md +147 -0
  45. data/docs/integrations/grape.md +19 -0
  46. data/docs/jsonapi/errors.md +56 -0
  47. data/docs/jsonapi/schema/schema.json +366 -0
  48. data/docs/jsonapi/schema.md +151 -0
  49. data/docs/rfcs/0000-namespace.md +106 -0
  50. data/docs/rfcs/template.md +15 -0
  51. data/lib/action_controller/serialization.rb +43 -38
  52. data/lib/active_model/serializable_resource.rb +11 -0
  53. data/lib/active_model/serializer/adapter/attributes.rb +15 -0
  54. data/lib/active_model/serializer/adapter/base.rb +18 -0
  55. data/lib/active_model/serializer/adapter/json.rb +15 -0
  56. data/lib/active_model/serializer/adapter/json_api.rb +15 -0
  57. data/lib/active_model/serializer/adapter/null.rb +15 -0
  58. data/lib/active_model/serializer/adapter.rb +24 -0
  59. data/lib/active_model/serializer/array_serializer.rb +12 -0
  60. data/lib/active_model/serializer/association.rb +71 -0
  61. data/lib/active_model/serializer/attribute.rb +25 -0
  62. data/lib/active_model/serializer/belongs_to_reflection.rb +11 -0
  63. data/lib/active_model/serializer/collection_serializer.rb +88 -0
  64. data/lib/active_model/serializer/concerns/caching.rb +300 -0
  65. data/lib/active_model/serializer/error_serializer.rb +14 -0
  66. data/lib/active_model/serializer/errors_serializer.rb +32 -0
  67. data/lib/active_model/serializer/field.rb +90 -0
  68. data/lib/active_model/serializer/fieldset.rb +31 -0
  69. data/lib/active_model/serializer/has_many_reflection.rb +10 -0
  70. data/lib/active_model/serializer/has_one_reflection.rb +7 -0
  71. data/lib/active_model/serializer/lazy_association.rb +96 -0
  72. data/lib/active_model/serializer/link.rb +21 -0
  73. data/lib/active_model/serializer/lint.rb +150 -0
  74. data/lib/active_model/serializer/null.rb +17 -0
  75. data/lib/active_model/serializer/reflection.rb +210 -0
  76. data/lib/active_model/{serializers → serializer}/version.rb +1 -1
  77. data/lib/active_model/serializer.rb +343 -442
  78. data/lib/active_model_serializers/adapter/attributes.rb +13 -0
  79. data/lib/active_model_serializers/adapter/base.rb +83 -0
  80. data/lib/active_model_serializers/adapter/json.rb +21 -0
  81. data/lib/active_model_serializers/adapter/json_api/deserialization.rb +213 -0
  82. data/lib/active_model_serializers/adapter/json_api/error.rb +96 -0
  83. data/lib/active_model_serializers/adapter/json_api/jsonapi.rb +49 -0
  84. data/lib/active_model_serializers/adapter/json_api/link.rb +83 -0
  85. data/lib/active_model_serializers/adapter/json_api/meta.rb +37 -0
  86. data/lib/active_model_serializers/adapter/json_api/pagination_links.rb +88 -0
  87. data/lib/active_model_serializers/adapter/json_api/relationship.rb +104 -0
  88. data/lib/active_model_serializers/adapter/json_api/resource_identifier.rb +66 -0
  89. data/lib/active_model_serializers/adapter/json_api.rb +533 -0
  90. data/lib/active_model_serializers/adapter/null.rb +9 -0
  91. data/lib/active_model_serializers/adapter.rb +98 -0
  92. data/lib/active_model_serializers/callbacks.rb +55 -0
  93. data/lib/active_model_serializers/deprecate.rb +54 -0
  94. data/lib/active_model_serializers/deserialization.rb +15 -0
  95. data/lib/active_model_serializers/json_pointer.rb +14 -0
  96. data/lib/active_model_serializers/logging.rb +122 -0
  97. data/lib/active_model_serializers/lookup_chain.rb +80 -0
  98. data/lib/active_model_serializers/model.rb +130 -0
  99. data/lib/active_model_serializers/railtie.rb +50 -0
  100. data/lib/active_model_serializers/register_jsonapi_renderer.rb +78 -0
  101. data/lib/active_model_serializers/serializable_resource.rb +82 -0
  102. data/lib/active_model_serializers/serialization_context.rb +39 -0
  103. data/lib/active_model_serializers/test/schema.rb +138 -0
  104. data/lib/active_model_serializers/test/serializer.rb +125 -0
  105. data/lib/active_model_serializers/test.rb +7 -0
  106. data/lib/active_model_serializers.rb +47 -81
  107. data/lib/generators/rails/USAGE +6 -0
  108. data/lib/generators/rails/resource_override.rb +10 -0
  109. data/lib/generators/rails/serializer_generator.rb +36 -0
  110. data/lib/generators/rails/templates/serializer.rb.erb +8 -0
  111. data/lib/grape/active_model_serializers.rb +16 -0
  112. data/lib/grape/formatters/active_model_serializers.rb +32 -0
  113. data/lib/grape/helpers/active_model_serializers.rb +17 -0
  114. data/lib/tasks/rubocop.rake +53 -0
  115. data/test/action_controller/adapter_selector_test.rb +62 -0
  116. data/test/action_controller/explicit_serializer_test.rb +135 -0
  117. data/test/action_controller/json/include_test.rb +246 -0
  118. data/test/action_controller/json_api/deserialization_test.rb +112 -0
  119. data/test/action_controller/json_api/errors_test.rb +40 -0
  120. data/test/action_controller/json_api/fields_test.rb +66 -0
  121. data/test/action_controller/json_api/linked_test.rb +202 -0
  122. data/test/action_controller/json_api/pagination_test.rb +124 -0
  123. data/test/action_controller/json_api/transform_test.rb +189 -0
  124. data/test/action_controller/lookup_proc_test.rb +49 -0
  125. data/test/action_controller/namespace_lookup_test.rb +232 -0
  126. data/test/action_controller/serialization_scope_name_test.rb +235 -0
  127. data/test/action_controller/serialization_test.rb +478 -0
  128. data/test/active_model_serializers/adapter_for_test.rb +208 -0
  129. data/test/active_model_serializers/json_pointer_test.rb +22 -0
  130. data/test/active_model_serializers/logging_test.rb +77 -0
  131. data/test/active_model_serializers/model_test.rb +142 -0
  132. data/test/active_model_serializers/railtie_test_isolated.rb +68 -0
  133. data/test/active_model_serializers/register_jsonapi_renderer_test_isolated.rb +161 -0
  134. data/test/active_model_serializers/serialization_context_test_isolated.rb +71 -0
  135. data/test/active_model_serializers/test/schema_test.rb +131 -0
  136. data/test/active_model_serializers/test/serializer_test.rb +62 -0
  137. data/test/active_record_test.rb +9 -0
  138. data/test/adapter/attributes_test.rb +40 -0
  139. data/test/adapter/deprecation_test.rb +100 -0
  140. data/test/adapter/json/belongs_to_test.rb +45 -0
  141. data/test/adapter/json/collection_test.rb +104 -0
  142. data/test/adapter/json/has_many_test.rb +53 -0
  143. data/test/adapter/json/transform_test.rb +93 -0
  144. data/test/adapter/json_api/belongs_to_test.rb +155 -0
  145. data/test/adapter/json_api/collection_test.rb +96 -0
  146. data/test/adapter/json_api/errors_test.rb +76 -0
  147. data/test/adapter/json_api/fields_test.rb +96 -0
  148. data/test/adapter/json_api/has_many_explicit_serializer_test.rb +96 -0
  149. data/test/adapter/json_api/has_many_test.rb +173 -0
  150. data/test/adapter/json_api/has_one_test.rb +80 -0
  151. data/test/adapter/json_api/include_data_if_sideloaded_test.rb +213 -0
  152. data/test/adapter/json_api/json_api_test.rb +33 -0
  153. data/test/adapter/json_api/linked_test.rb +413 -0
  154. data/test/adapter/json_api/links_test.rb +110 -0
  155. data/test/adapter/json_api/pagination_links_test.rb +206 -0
  156. data/test/adapter/json_api/parse_test.rb +137 -0
  157. data/test/adapter/json_api/relationship_test.rb +397 -0
  158. data/test/adapter/json_api/resource_meta_test.rb +100 -0
  159. data/test/adapter/json_api/toplevel_jsonapi_test.rb +82 -0
  160. data/test/adapter/json_api/transform_test.rb +512 -0
  161. data/test/adapter/json_api/type_test.rb +193 -0
  162. data/test/adapter/json_test.rb +46 -0
  163. data/test/adapter/null_test.rb +22 -0
  164. data/test/adapter/polymorphic_test.rb +218 -0
  165. data/test/adapter_test.rb +67 -0
  166. data/test/array_serializer_test.rb +20 -73
  167. data/test/benchmark/app.rb +65 -0
  168. data/test/benchmark/benchmarking_support.rb +67 -0
  169. data/test/benchmark/bm_active_record.rb +81 -0
  170. data/test/benchmark/bm_adapter.rb +38 -0
  171. data/test/benchmark/bm_caching.rb +119 -0
  172. data/test/benchmark/bm_lookup_chain.rb +83 -0
  173. data/test/benchmark/bm_transform.rb +45 -0
  174. data/test/benchmark/config.ru +3 -0
  175. data/test/benchmark/controllers.rb +83 -0
  176. data/test/benchmark/fixtures.rb +219 -0
  177. data/test/cache_test.rb +651 -0
  178. data/test/collection_serializer_test.rb +127 -0
  179. data/test/fixtures/active_record.rb +113 -0
  180. data/test/fixtures/poro.rb +225 -0
  181. data/test/generators/scaffold_controller_generator_test.rb +24 -0
  182. data/test/generators/serializer_generator_test.rb +75 -0
  183. data/test/grape_test.rb +196 -0
  184. data/test/lint_test.rb +49 -0
  185. data/test/logger_test.rb +20 -0
  186. data/test/poro_test.rb +9 -0
  187. data/test/serializable_resource_test.rb +79 -0
  188. data/test/serializers/association_macros_test.rb +37 -0
  189. data/test/serializers/associations_test.rb +518 -0
  190. data/test/serializers/attribute_test.rb +153 -0
  191. data/test/serializers/attributes_test.rb +52 -0
  192. data/test/serializers/caching_configuration_test_isolated.rb +170 -0
  193. data/test/serializers/configuration_test.rb +32 -0
  194. data/test/serializers/fieldset_test.rb +14 -0
  195. data/test/serializers/meta_test.rb +202 -0
  196. data/test/serializers/options_test.rb +32 -0
  197. data/test/serializers/read_attribute_for_serialization_test.rb +79 -0
  198. data/test/serializers/reflection_test.rb +479 -0
  199. data/test/serializers/root_test.rb +21 -0
  200. data/test/serializers/serialization_test.rb +55 -0
  201. data/test/serializers/serializer_for_test.rb +136 -0
  202. data/test/serializers/serializer_for_with_namespace_test.rb +88 -0
  203. data/test/support/custom_schemas/active_model_serializers/test/schema_test/my/index.json +6 -0
  204. data/test/support/isolated_unit.rb +84 -0
  205. data/test/support/rails5_shims.rb +53 -0
  206. data/test/support/rails_app.rb +38 -0
  207. data/test/support/schemas/active_model_serializers/test/schema_test/my/index.json +6 -0
  208. data/test/support/schemas/active_model_serializers/test/schema_test/my/show.json +6 -0
  209. data/test/support/schemas/custom/show.json +7 -0
  210. data/test/support/schemas/hyper_schema.json +93 -0
  211. data/test/support/schemas/render_using_json_api.json +43 -0
  212. data/test/support/schemas/simple_json_pointers.json +10 -0
  213. data/test/support/serialization_testing.rb +79 -0
  214. data/test/test_helper.rb +59 -21
  215. metadata +529 -43
  216. data/DESIGN.textile +0 -586
  217. data/Gemfile.edge +0 -9
  218. data/bench/perf.rb +0 -43
  219. data/cruft.md +0 -19
  220. data/lib/active_model/array_serializer.rb +0 -104
  221. data/lib/active_model/serializer/associations.rb +0 -233
  222. data/lib/active_record/serializer_override.rb +0 -16
  223. data/lib/generators/resource_override.rb +0 -13
  224. data/lib/generators/serializer/USAGE +0 -9
  225. data/lib/generators/serializer/serializer_generator.rb +0 -42
  226. data/lib/generators/serializer/templates/serializer.rb +0 -19
  227. data/test/association_test.rb +0 -592
  228. data/test/caching_test.rb +0 -96
  229. data/test/generators_test.rb +0 -85
  230. data/test/no_serialization_scope_test.rb +0 -34
  231. data/test/serialization_scope_name_test.rb +0 -67
  232. data/test/serialization_test.rb +0 -392
  233. data/test/serializer_support_test.rb +0 -51
  234. data/test/serializer_test.rb +0 -1465
  235. data/test/test_fakes.rb +0 -217
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_model_serializers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.10.8
5
5
  platform: ruby
6
6
  authors:
7
- - José Valim
8
- - Yehuda Katz
7
+ - Steve Klabnik
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-12-10 00:00:00.000000000 Z
11
+ date: 2018-11-01 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: activemodel
@@ -17,44 +16,232 @@ dependencies:
17
16
  requirements:
18
17
  - - ">="
19
18
  - !ruby/object:Gem::Version
20
- version: '3.0'
19
+ version: '4.1'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '6'
21
23
  type: :runtime
22
24
  prerelease: false
23
25
  version_requirements: !ruby/object:Gem::Requirement
24
26
  requirements:
25
27
  - - ">="
26
28
  - !ruby/object:Gem::Version
27
- version: '3.0'
29
+ version: '4.1'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '6'
28
33
  - !ruby/object:Gem::Dependency
29
- name: rails
34
+ name: actionpack
30
35
  requirement: !ruby/object:Gem::Requirement
31
36
  requirements:
32
37
  - - ">="
33
38
  - !ruby/object:Gem::Version
34
- version: '3.0'
39
+ version: '4.1'
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '6'
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '4.1'
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '6'
53
+ - !ruby/object:Gem::Dependency
54
+ name: railties
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
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'
120
+ type: :runtime
121
+ prerelease: false
122
+ version_requirements: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: '0.2'
127
+ - !ruby/object:Gem::Dependency
128
+ name: activerecord
129
+ requirement: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ version: '4.1'
134
+ - - "<"
135
+ - !ruby/object:Gem::Version
136
+ version: '6'
137
+ type: :development
138
+ prerelease: false
139
+ version_requirements: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - ">="
142
+ - !ruby/object:Gem::Version
143
+ version: '4.1'
144
+ - - "<"
145
+ - !ruby/object:Gem::Version
146
+ version: '6'
147
+ - !ruby/object:Gem::Dependency
148
+ name: kaminari
149
+ requirement: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - "~>"
152
+ - !ruby/object:Gem::Version
153
+ version: 0.16.3
35
154
  type: :development
36
155
  prerelease: false
37
156
  version_requirements: !ruby/object:Gem::Requirement
38
157
  requirements:
158
+ - - "~>"
159
+ - !ruby/object:Gem::Version
160
+ version: 0.16.3
161
+ - !ruby/object:Gem::Dependency
162
+ name: will_paginate
163
+ requirement: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - "~>"
166
+ - !ruby/object:Gem::Version
167
+ version: '3.0'
39
168
  - - ">="
169
+ - !ruby/object:Gem::Version
170
+ version: 3.0.7
171
+ type: :development
172
+ prerelease: false
173
+ version_requirements: !ruby/object:Gem::Requirement
174
+ requirements:
175
+ - - "~>"
40
176
  - !ruby/object:Gem::Version
41
177
  version: '3.0'
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: 3.0.7
181
+ - !ruby/object:Gem::Dependency
182
+ name: bundler
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '1.6'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '1.6'
195
+ - !ruby/object:Gem::Dependency
196
+ name: simplecov
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: '0.11'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: '0.11'
209
+ - !ruby/object:Gem::Dependency
210
+ name: timecop
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: '0.7'
216
+ type: :development
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - "~>"
221
+ - !ruby/object:Gem::Version
222
+ version: '0.7'
42
223
  - !ruby/object:Gem::Dependency
43
- name: pry
224
+ name: grape
44
225
  requirement: !ruby/object:Gem::Requirement
45
226
  requirements:
46
227
  - - ">="
47
228
  - !ruby/object:Gem::Version
48
- version: '0'
229
+ version: '0.13'
230
+ - - "<"
231
+ - !ruby/object:Gem::Version
232
+ version: 0.19.1
49
233
  type: :development
50
234
  prerelease: false
51
235
  version_requirements: !ruby/object:Gem::Requirement
52
236
  requirements:
53
237
  - - ">="
54
238
  - !ruby/object:Gem::Version
55
- version: '0'
239
+ version: '0.13'
240
+ - - "<"
241
+ - !ruby/object:Gem::Version
242
+ version: 0.19.1
56
243
  - !ruby/object:Gem::Dependency
57
- name: minitest
244
+ name: json_schema
58
245
  requirement: !ruby/object:Gem::Requirement
59
246
  requirements:
60
247
  - - ">="
@@ -67,50 +254,250 @@ dependencies:
67
254
  - - ">="
68
255
  - !ruby/object:Gem::Version
69
256
  version: '0'
70
- description: Making it easy to serialize models for client-side use
257
+ - !ruby/object:Gem::Dependency
258
+ name: rake
259
+ requirement: !ruby/object:Gem::Requirement
260
+ requirements:
261
+ - - ">="
262
+ - !ruby/object:Gem::Version
263
+ version: '10.0'
264
+ - - "<"
265
+ - !ruby/object:Gem::Version
266
+ version: '12.0'
267
+ type: :development
268
+ prerelease: false
269
+ version_requirements: !ruby/object:Gem::Requirement
270
+ requirements:
271
+ - - ">="
272
+ - !ruby/object:Gem::Version
273
+ version: '10.0'
274
+ - - "<"
275
+ - !ruby/object:Gem::Version
276
+ version: '12.0'
277
+ description: ActiveModel::Serializers allows you to generate your JSON in an object-oriented
278
+ and convention-driven manner.
71
279
  email:
72
- - jose.valim@gmail.com
73
- - wycats@gmail.com
280
+ - steve@steveklabnik.com
74
281
  executables: []
75
282
  extensions: []
76
283
  extra_rdoc_files: []
77
284
  files:
285
+ - ".github/ISSUE_TEMPLATE.md"
286
+ - ".github/PULL_REQUEST_TEMPLATE.md"
78
287
  - ".gitignore"
288
+ - ".rubocop.yml"
289
+ - ".simplecov"
79
290
  - ".travis.yml"
80
291
  - CHANGELOG.md
81
- - DESIGN.textile
292
+ - CODE_OF_CONDUCT.md
293
+ - CONTRIBUTING.md
82
294
  - Gemfile
83
- - Gemfile.edge
84
- - MIT-LICENSE.txt
295
+ - MIT-LICENSE
85
296
  - README.md
86
297
  - Rakefile
87
298
  - active_model_serializers.gemspec
88
- - bench/perf.rb
89
- - cruft.md
299
+ - appveyor.yml
300
+ - bin/bench
301
+ - bin/bench_regression
302
+ - bin/rubocop
303
+ - bin/serve_benchmark
304
+ - docs/README.md
305
+ - docs/STYLE.md
306
+ - docs/general/adapters.md
307
+ - docs/general/caching.md
308
+ - docs/general/configuration_options.md
309
+ - docs/general/deserialization.md
310
+ - docs/general/fields.md
311
+ - docs/general/getting_started.md
312
+ - docs/general/instrumentation.md
313
+ - docs/general/key_transforms.md
314
+ - docs/general/logging.md
315
+ - docs/general/rendering.md
316
+ - docs/general/serializers.md
317
+ - docs/how-open-source-maintained.jpg
318
+ - docs/howto/add_pagination_links.md
319
+ - docs/howto/add_relationship_links.md
320
+ - docs/howto/add_root_key.md
321
+ - docs/howto/grape_integration.md
322
+ - docs/howto/outside_controller_use.md
323
+ - docs/howto/passing_arbitrary_options.md
324
+ - docs/howto/serialize_poro.md
325
+ - docs/howto/test.md
326
+ - docs/howto/upgrade_from_0_8_to_0_10.md
327
+ - docs/integrations/ember-and-json-api.md
328
+ - docs/integrations/grape.md
329
+ - docs/jsonapi/errors.md
330
+ - docs/jsonapi/schema.md
331
+ - docs/jsonapi/schema/schema.json
332
+ - docs/rfcs/0000-namespace.md
333
+ - docs/rfcs/template.md
90
334
  - lib/action_controller/serialization.rb
91
- - lib/active_model/array_serializer.rb
335
+ - lib/active_model/serializable_resource.rb
92
336
  - lib/active_model/serializer.rb
93
- - lib/active_model/serializer/associations.rb
94
- - lib/active_model/serializers/version.rb
337
+ - lib/active_model/serializer/adapter.rb
338
+ - lib/active_model/serializer/adapter/attributes.rb
339
+ - lib/active_model/serializer/adapter/base.rb
340
+ - lib/active_model/serializer/adapter/json.rb
341
+ - lib/active_model/serializer/adapter/json_api.rb
342
+ - lib/active_model/serializer/adapter/null.rb
343
+ - lib/active_model/serializer/array_serializer.rb
344
+ - lib/active_model/serializer/association.rb
345
+ - lib/active_model/serializer/attribute.rb
346
+ - lib/active_model/serializer/belongs_to_reflection.rb
347
+ - lib/active_model/serializer/collection_serializer.rb
348
+ - lib/active_model/serializer/concerns/caching.rb
349
+ - lib/active_model/serializer/error_serializer.rb
350
+ - lib/active_model/serializer/errors_serializer.rb
351
+ - lib/active_model/serializer/field.rb
352
+ - lib/active_model/serializer/fieldset.rb
353
+ - lib/active_model/serializer/has_many_reflection.rb
354
+ - lib/active_model/serializer/has_one_reflection.rb
355
+ - lib/active_model/serializer/lazy_association.rb
356
+ - lib/active_model/serializer/link.rb
357
+ - lib/active_model/serializer/lint.rb
358
+ - lib/active_model/serializer/null.rb
359
+ - lib/active_model/serializer/reflection.rb
360
+ - lib/active_model/serializer/version.rb
95
361
  - lib/active_model_serializers.rb
96
- - lib/active_record/serializer_override.rb
97
- - lib/generators/resource_override.rb
98
- - lib/generators/serializer/USAGE
99
- - lib/generators/serializer/serializer_generator.rb
100
- - lib/generators/serializer/templates/serializer.rb
362
+ - lib/active_model_serializers/adapter.rb
363
+ - lib/active_model_serializers/adapter/attributes.rb
364
+ - lib/active_model_serializers/adapter/base.rb
365
+ - lib/active_model_serializers/adapter/json.rb
366
+ - lib/active_model_serializers/adapter/json_api.rb
367
+ - lib/active_model_serializers/adapter/json_api/deserialization.rb
368
+ - lib/active_model_serializers/adapter/json_api/error.rb
369
+ - lib/active_model_serializers/adapter/json_api/jsonapi.rb
370
+ - lib/active_model_serializers/adapter/json_api/link.rb
371
+ - lib/active_model_serializers/adapter/json_api/meta.rb
372
+ - lib/active_model_serializers/adapter/json_api/pagination_links.rb
373
+ - lib/active_model_serializers/adapter/json_api/relationship.rb
374
+ - lib/active_model_serializers/adapter/json_api/resource_identifier.rb
375
+ - lib/active_model_serializers/adapter/null.rb
376
+ - lib/active_model_serializers/callbacks.rb
377
+ - lib/active_model_serializers/deprecate.rb
378
+ - lib/active_model_serializers/deserialization.rb
379
+ - lib/active_model_serializers/json_pointer.rb
380
+ - lib/active_model_serializers/logging.rb
381
+ - lib/active_model_serializers/lookup_chain.rb
382
+ - lib/active_model_serializers/model.rb
383
+ - lib/active_model_serializers/railtie.rb
384
+ - lib/active_model_serializers/register_jsonapi_renderer.rb
385
+ - lib/active_model_serializers/serializable_resource.rb
386
+ - lib/active_model_serializers/serialization_context.rb
387
+ - lib/active_model_serializers/test.rb
388
+ - lib/active_model_serializers/test/schema.rb
389
+ - lib/active_model_serializers/test/serializer.rb
390
+ - lib/generators/rails/USAGE
391
+ - lib/generators/rails/resource_override.rb
392
+ - lib/generators/rails/serializer_generator.rb
393
+ - lib/generators/rails/templates/serializer.rb.erb
394
+ - lib/grape/active_model_serializers.rb
395
+ - lib/grape/formatters/active_model_serializers.rb
396
+ - lib/grape/helpers/active_model_serializers.rb
397
+ - lib/tasks/rubocop.rake
398
+ - test/action_controller/adapter_selector_test.rb
399
+ - test/action_controller/explicit_serializer_test.rb
400
+ - test/action_controller/json/include_test.rb
401
+ - test/action_controller/json_api/deserialization_test.rb
402
+ - test/action_controller/json_api/errors_test.rb
403
+ - test/action_controller/json_api/fields_test.rb
404
+ - test/action_controller/json_api/linked_test.rb
405
+ - test/action_controller/json_api/pagination_test.rb
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
409
+ - test/action_controller/serialization_scope_name_test.rb
410
+ - test/action_controller/serialization_test.rb
411
+ - test/active_model_serializers/adapter_for_test.rb
412
+ - test/active_model_serializers/json_pointer_test.rb
413
+ - test/active_model_serializers/logging_test.rb
414
+ - test/active_model_serializers/model_test.rb
415
+ - test/active_model_serializers/railtie_test_isolated.rb
416
+ - test/active_model_serializers/register_jsonapi_renderer_test_isolated.rb
417
+ - test/active_model_serializers/serialization_context_test_isolated.rb
418
+ - test/active_model_serializers/test/schema_test.rb
419
+ - test/active_model_serializers/test/serializer_test.rb
420
+ - test/active_record_test.rb
421
+ - test/adapter/attributes_test.rb
422
+ - test/adapter/deprecation_test.rb
423
+ - test/adapter/json/belongs_to_test.rb
424
+ - test/adapter/json/collection_test.rb
425
+ - test/adapter/json/has_many_test.rb
426
+ - test/adapter/json/transform_test.rb
427
+ - test/adapter/json_api/belongs_to_test.rb
428
+ - test/adapter/json_api/collection_test.rb
429
+ - test/adapter/json_api/errors_test.rb
430
+ - test/adapter/json_api/fields_test.rb
431
+ - test/adapter/json_api/has_many_explicit_serializer_test.rb
432
+ - test/adapter/json_api/has_many_test.rb
433
+ - test/adapter/json_api/has_one_test.rb
434
+ - test/adapter/json_api/include_data_if_sideloaded_test.rb
435
+ - test/adapter/json_api/json_api_test.rb
436
+ - test/adapter/json_api/linked_test.rb
437
+ - test/adapter/json_api/links_test.rb
438
+ - test/adapter/json_api/pagination_links_test.rb
439
+ - test/adapter/json_api/parse_test.rb
440
+ - test/adapter/json_api/relationship_test.rb
441
+ - test/adapter/json_api/resource_meta_test.rb
442
+ - test/adapter/json_api/toplevel_jsonapi_test.rb
443
+ - test/adapter/json_api/transform_test.rb
444
+ - test/adapter/json_api/type_test.rb
445
+ - test/adapter/json_test.rb
446
+ - test/adapter/null_test.rb
447
+ - test/adapter/polymorphic_test.rb
448
+ - test/adapter_test.rb
101
449
  - test/array_serializer_test.rb
102
- - test/association_test.rb
103
- - test/caching_test.rb
104
- - test/generators_test.rb
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
450
+ - test/benchmark/app.rb
451
+ - test/benchmark/benchmarking_support.rb
452
+ - test/benchmark/bm_active_record.rb
453
+ - test/benchmark/bm_adapter.rb
454
+ - test/benchmark/bm_caching.rb
455
+ - test/benchmark/bm_lookup_chain.rb
456
+ - test/benchmark/bm_transform.rb
457
+ - test/benchmark/config.ru
458
+ - test/benchmark/controllers.rb
459
+ - test/benchmark/fixtures.rb
460
+ - test/cache_test.rb
461
+ - test/collection_serializer_test.rb
462
+ - test/fixtures/active_record.rb
463
+ - test/fixtures/poro.rb
464
+ - test/generators/scaffold_controller_generator_test.rb
465
+ - test/generators/serializer_generator_test.rb
466
+ - test/grape_test.rb
467
+ - test/lint_test.rb
468
+ - test/logger_test.rb
469
+ - test/poro_test.rb
470
+ - test/serializable_resource_test.rb
471
+ - test/serializers/association_macros_test.rb
472
+ - test/serializers/associations_test.rb
473
+ - test/serializers/attribute_test.rb
474
+ - test/serializers/attributes_test.rb
475
+ - test/serializers/caching_configuration_test_isolated.rb
476
+ - test/serializers/configuration_test.rb
477
+ - test/serializers/fieldset_test.rb
478
+ - test/serializers/meta_test.rb
479
+ - test/serializers/options_test.rb
480
+ - test/serializers/read_attribute_for_serialization_test.rb
481
+ - test/serializers/reflection_test.rb
482
+ - test/serializers/root_test.rb
483
+ - test/serializers/serialization_test.rb
484
+ - test/serializers/serializer_for_test.rb
485
+ - test/serializers/serializer_for_with_namespace_test.rb
486
+ - test/support/custom_schemas/active_model_serializers/test/schema_test/my/index.json
487
+ - test/support/isolated_unit.rb
488
+ - test/support/rails5_shims.rb
489
+ - test/support/rails_app.rb
490
+ - test/support/schemas/active_model_serializers/test/schema_test/my/index.json
491
+ - test/support/schemas/active_model_serializers/test/schema_test/my/show.json
492
+ - test/support/schemas/custom/show.json
493
+ - test/support/schemas/hyper_schema.json
494
+ - test/support/schemas/render_using_json_api.json
495
+ - test/support/schemas/simple_json_pointers.json
496
+ - test/support/serialization_testing.rb
111
497
  - test/test_helper.rb
112
498
  homepage: https://github.com/rails-api/active_model_serializers
113
- licenses: []
499
+ licenses:
500
+ - MIT
114
501
  metadata: {}
115
502
  post_install_message:
116
503
  rdoc_options: []
@@ -120,7 +507,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
120
507
  requirements:
121
508
  - - ">="
122
509
  - !ruby/object:Gem::Version
123
- version: '0'
510
+ version: '2.1'
124
511
  required_rubygems_version: !ruby/object:Gem::Requirement
125
512
  requirements:
126
513
  - - ">="
@@ -128,9 +515,108 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
515
  version: '0'
129
516
  requirements: []
130
517
  rubyforge_project:
131
- rubygems_version: 2.2.2
518
+ rubygems_version: 2.7.6
132
519
  signing_key:
133
520
  specification_version: 4
134
- summary: Bringing consistency and object orientation to model serialization. Works
135
- great for client-side MVC frameworks!
136
- test_files: []
521
+ summary: Conventions-based JSON generation for Rails.
522
+ test_files:
523
+ - test/action_controller/adapter_selector_test.rb
524
+ - test/action_controller/explicit_serializer_test.rb
525
+ - test/action_controller/json/include_test.rb
526
+ - test/action_controller/json_api/deserialization_test.rb
527
+ - test/action_controller/json_api/errors_test.rb
528
+ - test/action_controller/json_api/fields_test.rb
529
+ - test/action_controller/json_api/linked_test.rb
530
+ - test/action_controller/json_api/pagination_test.rb
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
534
+ - test/action_controller/serialization_scope_name_test.rb
535
+ - test/action_controller/serialization_test.rb
536
+ - test/active_model_serializers/adapter_for_test.rb
537
+ - test/active_model_serializers/json_pointer_test.rb
538
+ - test/active_model_serializers/logging_test.rb
539
+ - test/active_model_serializers/model_test.rb
540
+ - test/active_model_serializers/railtie_test_isolated.rb
541
+ - test/active_model_serializers/register_jsonapi_renderer_test_isolated.rb
542
+ - test/active_model_serializers/serialization_context_test_isolated.rb
543
+ - test/active_model_serializers/test/schema_test.rb
544
+ - test/active_model_serializers/test/serializer_test.rb
545
+ - test/active_record_test.rb
546
+ - test/adapter/attributes_test.rb
547
+ - test/adapter/deprecation_test.rb
548
+ - test/adapter/json/belongs_to_test.rb
549
+ - test/adapter/json/collection_test.rb
550
+ - test/adapter/json/has_many_test.rb
551
+ - test/adapter/json/transform_test.rb
552
+ - test/adapter/json_api/belongs_to_test.rb
553
+ - test/adapter/json_api/collection_test.rb
554
+ - test/adapter/json_api/errors_test.rb
555
+ - test/adapter/json_api/fields_test.rb
556
+ - test/adapter/json_api/has_many_explicit_serializer_test.rb
557
+ - test/adapter/json_api/has_many_test.rb
558
+ - test/adapter/json_api/has_one_test.rb
559
+ - test/adapter/json_api/include_data_if_sideloaded_test.rb
560
+ - test/adapter/json_api/json_api_test.rb
561
+ - test/adapter/json_api/linked_test.rb
562
+ - test/adapter/json_api/links_test.rb
563
+ - test/adapter/json_api/pagination_links_test.rb
564
+ - test/adapter/json_api/parse_test.rb
565
+ - test/adapter/json_api/relationship_test.rb
566
+ - test/adapter/json_api/resource_meta_test.rb
567
+ - test/adapter/json_api/toplevel_jsonapi_test.rb
568
+ - test/adapter/json_api/transform_test.rb
569
+ - test/adapter/json_api/type_test.rb
570
+ - test/adapter/json_test.rb
571
+ - test/adapter/null_test.rb
572
+ - test/adapter/polymorphic_test.rb
573
+ - test/adapter_test.rb
574
+ - test/array_serializer_test.rb
575
+ - test/benchmark/app.rb
576
+ - test/benchmark/benchmarking_support.rb
577
+ - test/benchmark/bm_active_record.rb
578
+ - test/benchmark/bm_adapter.rb
579
+ - test/benchmark/bm_caching.rb
580
+ - test/benchmark/bm_lookup_chain.rb
581
+ - test/benchmark/bm_transform.rb
582
+ - test/benchmark/config.ru
583
+ - test/benchmark/controllers.rb
584
+ - test/benchmark/fixtures.rb
585
+ - test/cache_test.rb
586
+ - test/collection_serializer_test.rb
587
+ - test/fixtures/active_record.rb
588
+ - test/fixtures/poro.rb
589
+ - test/generators/scaffold_controller_generator_test.rb
590
+ - test/generators/serializer_generator_test.rb
591
+ - test/grape_test.rb
592
+ - test/lint_test.rb
593
+ - test/logger_test.rb
594
+ - test/poro_test.rb
595
+ - test/serializable_resource_test.rb
596
+ - test/serializers/association_macros_test.rb
597
+ - test/serializers/associations_test.rb
598
+ - test/serializers/attribute_test.rb
599
+ - test/serializers/attributes_test.rb
600
+ - test/serializers/caching_configuration_test_isolated.rb
601
+ - test/serializers/configuration_test.rb
602
+ - test/serializers/fieldset_test.rb
603
+ - test/serializers/meta_test.rb
604
+ - test/serializers/options_test.rb
605
+ - test/serializers/read_attribute_for_serialization_test.rb
606
+ - test/serializers/reflection_test.rb
607
+ - test/serializers/root_test.rb
608
+ - test/serializers/serialization_test.rb
609
+ - test/serializers/serializer_for_test.rb
610
+ - test/serializers/serializer_for_with_namespace_test.rb
611
+ - test/support/custom_schemas/active_model_serializers/test/schema_test/my/index.json
612
+ - test/support/isolated_unit.rb
613
+ - test/support/rails5_shims.rb
614
+ - test/support/rails_app.rb
615
+ - test/support/schemas/active_model_serializers/test/schema_test/my/index.json
616
+ - test/support/schemas/active_model_serializers/test/schema_test/my/show.json
617
+ - test/support/schemas/custom/show.json
618
+ - test/support/schemas/hyper_schema.json
619
+ - test/support/schemas/render_using_json_api.json
620
+ - test/support/schemas/simple_json_pointers.json
621
+ - test/support/serialization_testing.rb
622
+ - test/test_helper.rb