active_model_serializers 0.10.0 → 0.10.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +6 -5
  3. data/.travis.yml +17 -5
  4. data/CHANGELOG.md +126 -2
  5. data/CODE_OF_CONDUCT.md +74 -0
  6. data/Gemfile +5 -2
  7. data/README.md +166 -26
  8. data/Rakefile +3 -32
  9. data/active_model_serializers.gemspec +22 -25
  10. data/appveyor.yml +9 -3
  11. data/bin/rubocop +38 -0
  12. data/docs/README.md +2 -1
  13. data/docs/general/adapters.md +29 -11
  14. data/docs/general/caching.md +7 -1
  15. data/docs/general/configuration_options.md +70 -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 +62 -24
  21. data/docs/general/serializers.md +121 -13
  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 +4 -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 +13 -3
  34. data/lib/active_model/serializer/adapter/base.rb +2 -0
  35. data/lib/active_model/serializer/array_serializer.rb +8 -5
  36. data/lib/active_model/serializer/association.rb +62 -10
  37. data/lib/active_model/serializer/belongs_to_reflection.rb +4 -3
  38. data/lib/active_model/serializer/collection_serializer.rb +35 -12
  39. data/lib/active_model/serializer/{caching.rb → concerns/caching.rb} +82 -115
  40. data/lib/active_model/serializer/error_serializer.rb +11 -7
  41. data/lib/active_model/serializer/errors_serializer.rb +25 -20
  42. data/lib/active_model/serializer/has_many_reflection.rb +3 -3
  43. data/lib/active_model/serializer/has_one_reflection.rb +1 -4
  44. data/lib/active_model/serializer/lazy_association.rb +95 -0
  45. data/lib/active_model/serializer/lint.rb +134 -130
  46. data/lib/active_model/serializer/reflection.rb +127 -67
  47. data/lib/active_model/serializer/version.rb +1 -1
  48. data/lib/active_model/serializer.rb +296 -79
  49. data/lib/active_model_serializers/adapter/attributes.rb +3 -66
  50. data/lib/active_model_serializers/adapter/base.rb +39 -39
  51. data/lib/active_model_serializers/adapter/json_api/deserialization.rb +1 -1
  52. data/lib/active_model_serializers/adapter/json_api/link.rb +1 -1
  53. data/lib/active_model_serializers/adapter/json_api/pagination_links.rb +8 -1
  54. data/lib/active_model_serializers/adapter/json_api/relationship.rb +63 -23
  55. data/lib/active_model_serializers/adapter/json_api/resource_identifier.rb +32 -9
  56. data/lib/active_model_serializers/adapter/json_api.rb +71 -57
  57. data/lib/active_model_serializers/adapter.rb +6 -0
  58. data/lib/active_model_serializers/deprecate.rb +1 -2
  59. data/lib/active_model_serializers/deserialization.rb +2 -0
  60. data/lib/active_model_serializers/lookup_chain.rb +80 -0
  61. data/lib/active_model_serializers/model.rb +109 -28
  62. data/lib/active_model_serializers/railtie.rb +3 -1
  63. data/lib/active_model_serializers/register_jsonapi_renderer.rb +44 -31
  64. data/lib/active_model_serializers/serializable_resource.rb +6 -5
  65. data/lib/active_model_serializers/serialization_context.rb +10 -3
  66. data/lib/active_model_serializers/test/schema.rb +2 -2
  67. data/lib/active_model_serializers.rb +15 -0
  68. data/lib/generators/rails/resource_override.rb +1 -1
  69. data/lib/generators/rails/serializer_generator.rb +4 -4
  70. data/lib/grape/active_model_serializers.rb +7 -5
  71. data/lib/grape/formatters/active_model_serializers.rb +19 -2
  72. data/lib/grape/helpers/active_model_serializers.rb +1 -0
  73. data/lib/tasks/rubocop.rake +53 -0
  74. data/test/action_controller/adapter_selector_test.rb +14 -5
  75. data/test/action_controller/explicit_serializer_test.rb +5 -4
  76. data/test/action_controller/json/include_test.rb +106 -27
  77. data/test/action_controller/json_api/errors_test.rb +8 -9
  78. data/test/action_controller/json_api/fields_test.rb +66 -0
  79. data/test/action_controller/json_api/linked_test.rb +29 -24
  80. data/test/action_controller/json_api/pagination_test.rb +19 -19
  81. data/test/action_controller/json_api/transform_test.rb +11 -3
  82. data/test/action_controller/lookup_proc_test.rb +49 -0
  83. data/test/action_controller/namespace_lookup_test.rb +232 -0
  84. data/test/action_controller/serialization_scope_name_test.rb +12 -6
  85. data/test/action_controller/serialization_test.rb +12 -9
  86. data/test/active_model_serializers/json_pointer_test.rb +15 -13
  87. data/test/active_model_serializers/model_test.rb +137 -4
  88. data/test/active_model_serializers/railtie_test_isolated.rb +12 -7
  89. data/test/active_model_serializers/register_jsonapi_renderer_test_isolated.rb +161 -0
  90. data/test/active_model_serializers/serialization_context_test_isolated.rb +23 -10
  91. data/test/active_model_serializers/test/schema_test.rb +3 -2
  92. data/test/adapter/attributes_test.rb +40 -0
  93. data/test/adapter/json/collection_test.rb +14 -0
  94. data/test/adapter/json/has_many_test.rb +10 -2
  95. data/test/adapter/json/transform_test.rb +15 -15
  96. data/test/adapter/json_api/collection_test.rb +4 -3
  97. data/test/adapter/json_api/errors_test.rb +17 -19
  98. data/test/adapter/json_api/fields_test.rb +12 -3
  99. data/test/adapter/json_api/has_many_test.rb +49 -20
  100. data/test/adapter/json_api/include_data_if_sideloaded_test.rb +183 -0
  101. data/test/adapter/json_api/json_api_test.rb +5 -7
  102. data/test/adapter/json_api/linked_test.rb +33 -12
  103. data/test/adapter/json_api/links_test.rb +4 -2
  104. data/test/adapter/json_api/pagination_links_test.rb +35 -8
  105. data/test/adapter/json_api/relationship_test.rb +309 -73
  106. data/test/adapter/json_api/resource_identifier_test.rb +27 -2
  107. data/test/adapter/json_api/resource_meta_test.rb +3 -3
  108. data/test/adapter/json_api/transform_test.rb +263 -253
  109. data/test/adapter/json_api/type_test.rb +1 -1
  110. data/test/adapter/json_test.rb +8 -7
  111. data/test/adapter/null_test.rb +1 -2
  112. data/test/adapter/polymorphic_test.rb +5 -5
  113. data/test/adapter_test.rb +1 -1
  114. data/test/benchmark/app.rb +1 -1
  115. data/test/benchmark/benchmarking_support.rb +1 -1
  116. data/test/benchmark/bm_active_record.rb +81 -0
  117. data/test/benchmark/bm_adapter.rb +38 -0
  118. data/test/benchmark/bm_caching.rb +16 -16
  119. data/test/benchmark/bm_lookup_chain.rb +83 -0
  120. data/test/benchmark/bm_transform.rb +21 -10
  121. data/test/benchmark/controllers.rb +16 -17
  122. data/test/benchmark/fixtures.rb +72 -72
  123. data/test/cache_test.rb +235 -69
  124. data/test/collection_serializer_test.rb +25 -12
  125. data/test/fixtures/active_record.rb +45 -10
  126. data/test/fixtures/poro.rb +124 -181
  127. data/test/generators/serializer_generator_test.rb +23 -5
  128. data/test/grape_test.rb +170 -56
  129. data/test/lint_test.rb +1 -1
  130. data/test/logger_test.rb +13 -11
  131. data/test/serializable_resource_test.rb +18 -22
  132. data/test/serializers/association_macros_test.rb +3 -2
  133. data/test/serializers/associations_test.rb +178 -49
  134. data/test/serializers/attribute_test.rb +5 -3
  135. data/test/serializers/attributes_test.rb +1 -1
  136. data/test/serializers/caching_configuration_test_isolated.rb +6 -6
  137. data/test/serializers/fieldset_test.rb +1 -1
  138. data/test/serializers/meta_test.rb +12 -6
  139. data/test/serializers/options_test.rb +17 -6
  140. data/test/serializers/read_attribute_for_serialization_test.rb +3 -3
  141. data/test/serializers/reflection_test.rb +427 -0
  142. data/test/serializers/root_test.rb +1 -1
  143. data/test/serializers/serialization_test.rb +2 -2
  144. data/test/serializers/serializer_for_test.rb +12 -10
  145. data/test/serializers/serializer_for_with_namespace_test.rb +88 -0
  146. data/test/support/isolated_unit.rb +5 -2
  147. data/test/support/rails5_shims.rb +8 -2
  148. data/test/support/rails_app.rb +2 -9
  149. data/test/support/serialization_testing.rb +23 -5
  150. data/test/test_helper.rb +13 -0
  151. metadata +105 -42
  152. data/.rubocop_todo.yml +0 -167
  153. data/docs/ARCHITECTURE.md +0 -126
  154. data/lib/active_model/serializer/associations.rb +0 -100
  155. data/lib/active_model/serializer/attributes.rb +0 -82
  156. data/lib/active_model/serializer/collection_reflection.rb +0 -7
  157. data/lib/active_model/serializer/configuration.rb +0 -35
  158. data/lib/active_model/serializer/include_tree.rb +0 -111
  159. data/lib/active_model/serializer/links.rb +0 -35
  160. data/lib/active_model/serializer/meta.rb +0 -29
  161. data/lib/active_model/serializer/singular_reflection.rb +0 -7
  162. data/lib/active_model/serializer/type.rb +0 -25
  163. data/lib/active_model_serializers/key_transform.rb +0 -70
  164. data/test/active_model_serializers/key_transform_test.rb +0 -263
  165. data/test/adapter/json_api/relationships_test.rb +0 -199
  166. data/test/include_tree/from_include_args_test.rb +0 -26
  167. data/test/include_tree/from_string_test.rb +0 -94
  168. data/test/include_tree/include_args_to_hash_test.rb +0 -64
@@ -1,7 +1,7 @@
1
1
  module Rails5Shims
2
2
  module ControllerTests
3
3
  # https://github.com/rails/rails/blob/b217354/actionpack/lib/action_controller/test_case.rb
4
- REQUEST_KWARGS = [:params, :session, :flash, :method, :body, :xhr].freeze
4
+ REQUEST_KWARGS = [:params, :headers, :session, :flash, :method, :body, :xhr].freeze
5
5
 
6
6
  def get(path, *args)
7
7
  fold_kwargs!(args)
@@ -30,7 +30,12 @@ module Rails5Shims
30
30
  return unless hash.respond_to?(:key)
31
31
  Rails5Shims::ControllerTests::REQUEST_KWARGS.each do |kwarg|
32
32
  next unless hash.key?(kwarg)
33
- hash.merge! hash.delete(kwarg)
33
+ value = hash.delete(kwarg)
34
+ if value.is_a? String
35
+ args.insert(0, value)
36
+ else
37
+ hash.merge! value
38
+ end
34
39
  end
35
40
  end
36
41
 
@@ -44,4 +49,5 @@ module Rails5Shims
44
49
  end
45
50
  if Rails::VERSION::MAJOR < 5
46
51
  ActionController::TestCase.send :include, Rails5Shims::ControllerTests
52
+ ActionDispatch::IntegrationTest.send :include, Rails5Shims::ControllerTests
47
53
  end
@@ -6,6 +6,8 @@ module ActiveModelSerializers
6
6
  config.active_support.test_order = :random
7
7
  config.action_controller.perform_caching = true
8
8
  config.action_controller.cache_store = :memory_store
9
+
10
+ config.filter_parameters += [:password]
9
11
  end
10
12
 
11
13
  app.routes.default_url_options = { host: 'example.com' }
@@ -22,15 +24,6 @@ ActionController::TestCase.class_eval do
22
24
  def setup
23
25
  @routes = Routes
24
26
  end
25
-
26
- # For Rails5
27
- # https://github.com/rails/rails/commit/ca83436d1b3b6cedd1eca2259f65661e69b01909#diff-b9bbf56e85d3fe1999f16317f2751e76L17
28
- def assigns(key = nil)
29
- warn "DEPRECATION: Calling 'assigns(#{key})' from #{caller[0]}"
30
- assigns = {}.with_indifferent_access
31
- @controller.view_assigns.each { |k, v| assigns.regular_writer(k, v) }
32
- key.nil? ? assigns : assigns[key]
33
- end
34
27
  end
35
28
 
36
29
  # ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../test/dummy/db/migrate", __FILE__)]
@@ -9,6 +9,22 @@ module SerializationTesting
9
9
  ActiveModelSerializers::SerializableResource.new(obj).to_json
10
10
  end
11
11
 
12
+ def with_namespace_separator(separator)
13
+ original_separator = ActiveModelSerializers.config.jsonapi_namespace_separator
14
+ ActiveModelSerializers.config.jsonapi_namespace_separator = separator
15
+ yield
16
+ ensure
17
+ ActiveModelSerializers.config.jsonapi_namespace_separator = original_separator
18
+ end
19
+
20
+ def with_prepended_lookup(lookup_proc)
21
+ original_lookup = ActiveModelSerializers.config.serializer_lookup_cahin
22
+ ActiveModelSerializers.config.serializer_lookup_chain.unshift lookup_proc
23
+ yield
24
+ ensure
25
+ ActiveModelSerializers.config.serializer_lookup_cahin = original_lookup
26
+ end
27
+
12
28
  # Aliased as :with_configured_adapter to clarify that
13
29
  # this method tests the configured adapter.
14
30
  # When not testing configuration, it may be preferable
@@ -44,10 +60,12 @@ module SerializationTesting
44
60
  end
45
61
  end
46
62
 
47
- class Minitest::Test
48
- def before_setup
49
- ActionController::Base.cache_store.clear
50
- end
63
+ module Minitest
64
+ class Test
65
+ def before_setup
66
+ ActionController::Base.cache_store.clear
67
+ end
51
68
 
52
- include SerializationTesting
69
+ include SerializationTesting
70
+ end
53
71
  end
data/test/test_helper.rb CHANGED
@@ -9,6 +9,7 @@ rescue LoadError
9
9
  STDERR.puts 'Running without SimpleCov'
10
10
  end
11
11
 
12
+ require 'pry'
12
13
  require 'timecop'
13
14
  require 'rails'
14
15
  require 'action_controller'
@@ -39,6 +40,18 @@ require 'minitest'
39
40
  require 'minitest/autorun'
40
41
  Minitest.backtrace_filter = Minitest::BacktraceFilter.new
41
42
 
43
+ module TestHelper
44
+ module_function
45
+
46
+ def silence_warnings
47
+ original_verbose = $VERBOSE
48
+ $VERBOSE = nil
49
+ yield
50
+ ensure
51
+ $VERBOSE = original_verbose
52
+ end
53
+ end
54
+
42
55
  require 'support/rails_app'
43
56
 
44
57
  # require "rails/test_help"
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.6
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: 2017-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -16,56 +16,114 @@ 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: jsonapi-renderer
75
+ requirement: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: 0.1.1.beta1
80
+ - - "<"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.2'
48
83
  type: :runtime
49
84
  prerelease: false
50
85
  version_requirements: !ruby/object:Gem::Requirement
51
86
  requirements:
52
87
  - - ">="
53
88
  - !ruby/object:Gem::Version
54
- version: '4.0'
89
+ version: 0.1.1.beta1
90
+ - - "<"
91
+ - !ruby/object:Gem::Version
92
+ version: '0.2'
93
+ - !ruby/object:Gem::Dependency
94
+ name: case_transform
95
+ requirement: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0.2'
100
+ type: :runtime
101
+ prerelease: false
102
+ version_requirements: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: '0.2'
55
107
  - !ruby/object:Gem::Dependency
56
108
  name: activerecord
57
109
  requirement: !ruby/object:Gem::Requirement
58
110
  requirements:
59
111
  - - ">="
60
112
  - !ruby/object:Gem::Version
61
- version: '4.0'
113
+ version: '4.1'
114
+ - - "<"
115
+ - !ruby/object:Gem::Version
116
+ version: '6'
62
117
  type: :development
63
118
  prerelease: false
64
119
  version_requirements: !ruby/object:Gem::Requirement
65
120
  requirements:
66
121
  - - ">="
67
122
  - !ruby/object:Gem::Version
68
- version: '4.0'
123
+ version: '4.1'
124
+ - - "<"
125
+ - !ruby/object:Gem::Version
126
+ version: '6'
69
127
  - !ruby/object:Gem::Dependency
70
128
  name: kaminari
71
129
  requirement: !ruby/object:Gem::Requirement
@@ -151,7 +209,7 @@ dependencies:
151
209
  version: '0.13'
152
210
  - - "<"
153
211
  - !ruby/object:Gem::Version
154
- version: '1.0'
212
+ version: 0.19.1
155
213
  type: :development
156
214
  prerelease: false
157
215
  version_requirements: !ruby/object:Gem::Requirement
@@ -161,7 +219,7 @@ dependencies:
161
219
  version: '0.13'
162
220
  - - "<"
163
221
  - !ruby/object:Gem::Version
164
- version: '1.0'
222
+ version: 0.19.1
165
223
  - !ruby/object:Gem::Dependency
166
224
  name: json_schema
167
225
  requirement: !ruby/object:Gem::Requirement
@@ -208,10 +266,10 @@ files:
208
266
  - ".github/PULL_REQUEST_TEMPLATE.md"
209
267
  - ".gitignore"
210
268
  - ".rubocop.yml"
211
- - ".rubocop_todo.yml"
212
269
  - ".simplecov"
213
270
  - ".travis.yml"
214
271
  - CHANGELOG.md
272
+ - CODE_OF_CONDUCT.md
215
273
  - CONTRIBUTING.md
216
274
  - Gemfile
217
275
  - MIT-LICENSE
@@ -221,14 +279,15 @@ files:
221
279
  - appveyor.yml
222
280
  - bin/bench
223
281
  - bin/bench_regression
282
+ - bin/rubocop
224
283
  - bin/serve_benchmark
225
- - docs/ARCHITECTURE.md
226
284
  - docs/README.md
227
285
  - docs/STYLE.md
228
286
  - docs/general/adapters.md
229
287
  - docs/general/caching.md
230
288
  - docs/general/configuration_options.md
231
289
  - docs/general/deserialization.md
290
+ - docs/general/fields.md
232
291
  - docs/general/getting_started.md
233
292
  - docs/general/instrumentation.md
234
293
  - docs/general/key_transforms.md
@@ -237,11 +296,14 @@ files:
237
296
  - docs/general/serializers.md
238
297
  - docs/how-open-source-maintained.jpg
239
298
  - docs/howto/add_pagination_links.md
299
+ - docs/howto/add_relationship_links.md
240
300
  - docs/howto/add_root_key.md
301
+ - docs/howto/grape_integration.md
241
302
  - docs/howto/outside_controller_use.md
242
303
  - docs/howto/passing_arbitrary_options.md
243
304
  - docs/howto/serialize_poro.md
244
305
  - docs/howto/test.md
306
+ - docs/howto/upgrade_from_0_8_to_0_10.md
245
307
  - docs/integrations/ember-and-json-api.md
246
308
  - docs/integrations/grape.md
247
309
  - docs/jsonapi/errors.md
@@ -260,28 +322,20 @@ files:
260
322
  - lib/active_model/serializer/adapter/null.rb
261
323
  - lib/active_model/serializer/array_serializer.rb
262
324
  - lib/active_model/serializer/association.rb
263
- - lib/active_model/serializer/associations.rb
264
325
  - lib/active_model/serializer/attribute.rb
265
- - lib/active_model/serializer/attributes.rb
266
326
  - lib/active_model/serializer/belongs_to_reflection.rb
267
- - lib/active_model/serializer/caching.rb
268
- - lib/active_model/serializer/collection_reflection.rb
269
327
  - lib/active_model/serializer/collection_serializer.rb
270
- - lib/active_model/serializer/configuration.rb
328
+ - lib/active_model/serializer/concerns/caching.rb
271
329
  - lib/active_model/serializer/error_serializer.rb
272
330
  - lib/active_model/serializer/errors_serializer.rb
273
331
  - lib/active_model/serializer/field.rb
274
332
  - lib/active_model/serializer/fieldset.rb
275
333
  - lib/active_model/serializer/has_many_reflection.rb
276
334
  - lib/active_model/serializer/has_one_reflection.rb
277
- - lib/active_model/serializer/include_tree.rb
278
- - lib/active_model/serializer/links.rb
335
+ - lib/active_model/serializer/lazy_association.rb
279
336
  - lib/active_model/serializer/lint.rb
280
- - lib/active_model/serializer/meta.rb
281
337
  - lib/active_model/serializer/null.rb
282
338
  - lib/active_model/serializer/reflection.rb
283
- - lib/active_model/serializer/singular_reflection.rb
284
- - lib/active_model/serializer/type.rb
285
339
  - lib/active_model/serializer/version.rb
286
340
  - lib/active_model_serializers.rb
287
341
  - lib/active_model_serializers/adapter.rb
@@ -302,8 +356,8 @@ files:
302
356
  - lib/active_model_serializers/deprecate.rb
303
357
  - lib/active_model_serializers/deserialization.rb
304
358
  - lib/active_model_serializers/json_pointer.rb
305
- - lib/active_model_serializers/key_transform.rb
306
359
  - lib/active_model_serializers/logging.rb
360
+ - lib/active_model_serializers/lookup_chain.rb
307
361
  - lib/active_model_serializers/model.rb
308
362
  - lib/active_model_serializers/railtie.rb
309
363
  - lib/active_model_serializers/register_jsonapi_renderer.rb
@@ -319,26 +373,31 @@ files:
319
373
  - lib/grape/active_model_serializers.rb
320
374
  - lib/grape/formatters/active_model_serializers.rb
321
375
  - lib/grape/helpers/active_model_serializers.rb
376
+ - lib/tasks/rubocop.rake
322
377
  - test/action_controller/adapter_selector_test.rb
323
378
  - test/action_controller/explicit_serializer_test.rb
324
379
  - test/action_controller/json/include_test.rb
325
380
  - test/action_controller/json_api/deserialization_test.rb
326
381
  - test/action_controller/json_api/errors_test.rb
382
+ - test/action_controller/json_api/fields_test.rb
327
383
  - test/action_controller/json_api/linked_test.rb
328
384
  - test/action_controller/json_api/pagination_test.rb
329
385
  - test/action_controller/json_api/transform_test.rb
386
+ - test/action_controller/lookup_proc_test.rb
387
+ - test/action_controller/namespace_lookup_test.rb
330
388
  - test/action_controller/serialization_scope_name_test.rb
331
389
  - test/action_controller/serialization_test.rb
332
390
  - test/active_model_serializers/adapter_for_test.rb
333
391
  - test/active_model_serializers/json_pointer_test.rb
334
- - test/active_model_serializers/key_transform_test.rb
335
392
  - test/active_model_serializers/logging_test.rb
336
393
  - test/active_model_serializers/model_test.rb
337
394
  - test/active_model_serializers/railtie_test_isolated.rb
395
+ - test/active_model_serializers/register_jsonapi_renderer_test_isolated.rb
338
396
  - test/active_model_serializers/serialization_context_test_isolated.rb
339
397
  - test/active_model_serializers/test/schema_test.rb
340
398
  - test/active_model_serializers/test/serializer_test.rb
341
399
  - test/active_record_test.rb
400
+ - test/adapter/attributes_test.rb
342
401
  - test/adapter/deprecation_test.rb
343
402
  - test/adapter/json/belongs_to_test.rb
344
403
  - test/adapter/json/collection_test.rb
@@ -352,13 +411,13 @@ files:
352
411
  - test/adapter/json_api/has_many_explicit_serializer_test.rb
353
412
  - test/adapter/json_api/has_many_test.rb
354
413
  - test/adapter/json_api/has_one_test.rb
414
+ - test/adapter/json_api/include_data_if_sideloaded_test.rb
355
415
  - test/adapter/json_api/json_api_test.rb
356
416
  - test/adapter/json_api/linked_test.rb
357
417
  - test/adapter/json_api/links_test.rb
358
418
  - test/adapter/json_api/pagination_links_test.rb
359
419
  - test/adapter/json_api/parse_test.rb
360
420
  - test/adapter/json_api/relationship_test.rb
361
- - test/adapter/json_api/relationships_test.rb
362
421
  - test/adapter/json_api/resource_identifier_test.rb
363
422
  - test/adapter/json_api/resource_meta_test.rb
364
423
  - test/adapter/json_api/toplevel_jsonapi_test.rb
@@ -371,7 +430,10 @@ files:
371
430
  - test/array_serializer_test.rb
372
431
  - test/benchmark/app.rb
373
432
  - test/benchmark/benchmarking_support.rb
433
+ - test/benchmark/bm_active_record.rb
434
+ - test/benchmark/bm_adapter.rb
374
435
  - test/benchmark/bm_caching.rb
436
+ - test/benchmark/bm_lookup_chain.rb
375
437
  - test/benchmark/bm_transform.rb
376
438
  - test/benchmark/config.ru
377
439
  - test/benchmark/controllers.rb
@@ -383,9 +445,6 @@ files:
383
445
  - test/generators/scaffold_controller_generator_test.rb
384
446
  - test/generators/serializer_generator_test.rb
385
447
  - 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
448
  - test/lint_test.rb
390
449
  - test/logger_test.rb
391
450
  - test/poro_test.rb
@@ -400,9 +459,11 @@ files:
400
459
  - test/serializers/meta_test.rb
401
460
  - test/serializers/options_test.rb
402
461
  - test/serializers/read_attribute_for_serialization_test.rb
462
+ - test/serializers/reflection_test.rb
403
463
  - test/serializers/root_test.rb
404
464
  - test/serializers/serialization_test.rb
405
465
  - test/serializers/serializer_for_test.rb
466
+ - test/serializers/serializer_for_with_namespace_test.rb
406
467
  - test/support/custom_schemas/active_model_serializers/test/schema_test/my/index.json
407
468
  - test/support/isolated_unit.rb
408
469
  - test/support/rails5_shims.rb
@@ -419,10 +480,7 @@ homepage: https://github.com/rails-api/active_model_serializers
419
480
  licenses:
420
481
  - MIT
421
482
  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.
483
+ post_install_message:
426
484
  rdoc_options: []
427
485
  require_paths:
428
486
  - lib
@@ -430,7 +488,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
430
488
  requirements:
431
489
  - - ">="
432
490
  - !ruby/object:Gem::Version
433
- version: 2.0.0
491
+ version: '2.1'
434
492
  required_rubygems_version: !ruby/object:Gem::Requirement
435
493
  requirements:
436
494
  - - ">="
@@ -438,7 +496,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
438
496
  version: '0'
439
497
  requirements: []
440
498
  rubyforge_project:
441
- rubygems_version: 2.4.5
499
+ rubygems_version: 2.4.8
442
500
  signing_key:
443
501
  specification_version: 4
444
502
  summary: Conventions-based JSON generation for Rails.
@@ -448,21 +506,25 @@ test_files:
448
506
  - test/action_controller/json/include_test.rb
449
507
  - test/action_controller/json_api/deserialization_test.rb
450
508
  - test/action_controller/json_api/errors_test.rb
509
+ - test/action_controller/json_api/fields_test.rb
451
510
  - test/action_controller/json_api/linked_test.rb
452
511
  - test/action_controller/json_api/pagination_test.rb
453
512
  - test/action_controller/json_api/transform_test.rb
513
+ - test/action_controller/lookup_proc_test.rb
514
+ - test/action_controller/namespace_lookup_test.rb
454
515
  - test/action_controller/serialization_scope_name_test.rb
455
516
  - test/action_controller/serialization_test.rb
456
517
  - test/active_model_serializers/adapter_for_test.rb
457
518
  - test/active_model_serializers/json_pointer_test.rb
458
- - test/active_model_serializers/key_transform_test.rb
459
519
  - test/active_model_serializers/logging_test.rb
460
520
  - test/active_model_serializers/model_test.rb
461
521
  - test/active_model_serializers/railtie_test_isolated.rb
522
+ - test/active_model_serializers/register_jsonapi_renderer_test_isolated.rb
462
523
  - test/active_model_serializers/serialization_context_test_isolated.rb
463
524
  - test/active_model_serializers/test/schema_test.rb
464
525
  - test/active_model_serializers/test/serializer_test.rb
465
526
  - test/active_record_test.rb
527
+ - test/adapter/attributes_test.rb
466
528
  - test/adapter/deprecation_test.rb
467
529
  - test/adapter/json/belongs_to_test.rb
468
530
  - test/adapter/json/collection_test.rb
@@ -476,13 +538,13 @@ test_files:
476
538
  - test/adapter/json_api/has_many_explicit_serializer_test.rb
477
539
  - test/adapter/json_api/has_many_test.rb
478
540
  - test/adapter/json_api/has_one_test.rb
541
+ - test/adapter/json_api/include_data_if_sideloaded_test.rb
479
542
  - test/adapter/json_api/json_api_test.rb
480
543
  - test/adapter/json_api/linked_test.rb
481
544
  - test/adapter/json_api/links_test.rb
482
545
  - test/adapter/json_api/pagination_links_test.rb
483
546
  - test/adapter/json_api/parse_test.rb
484
547
  - test/adapter/json_api/relationship_test.rb
485
- - test/adapter/json_api/relationships_test.rb
486
548
  - test/adapter/json_api/resource_identifier_test.rb
487
549
  - test/adapter/json_api/resource_meta_test.rb
488
550
  - test/adapter/json_api/toplevel_jsonapi_test.rb
@@ -495,7 +557,10 @@ test_files:
495
557
  - test/array_serializer_test.rb
496
558
  - test/benchmark/app.rb
497
559
  - test/benchmark/benchmarking_support.rb
560
+ - test/benchmark/bm_active_record.rb
561
+ - test/benchmark/bm_adapter.rb
498
562
  - test/benchmark/bm_caching.rb
563
+ - test/benchmark/bm_lookup_chain.rb
499
564
  - test/benchmark/bm_transform.rb
500
565
  - test/benchmark/config.ru
501
566
  - test/benchmark/controllers.rb
@@ -507,9 +572,6 @@ test_files:
507
572
  - test/generators/scaffold_controller_generator_test.rb
508
573
  - test/generators/serializer_generator_test.rb
509
574
  - 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
575
  - test/lint_test.rb
514
576
  - test/logger_test.rb
515
577
  - test/poro_test.rb
@@ -524,9 +586,11 @@ test_files:
524
586
  - test/serializers/meta_test.rb
525
587
  - test/serializers/options_test.rb
526
588
  - test/serializers/read_attribute_for_serialization_test.rb
589
+ - test/serializers/reflection_test.rb
527
590
  - test/serializers/root_test.rb
528
591
  - test/serializers/serialization_test.rb
529
592
  - test/serializers/serializer_for_test.rb
593
+ - test/serializers/serializer_for_with_namespace_test.rb
530
594
  - test/support/custom_schemas/active_model_serializers/test/schema_test/my/index.json
531
595
  - test/support/isolated_unit.rb
532
596
  - test/support/rails5_shims.rb
@@ -539,4 +603,3 @@ test_files:
539
603
  - test/support/schemas/simple_json_pointers.json
540
604
  - test/support/serialization_testing.rb
541
605
  - test/test_helper.rb
542
- has_rdoc: