active_model_serializers 0.10.3 → 0.10.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (224) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +154 -2
  3. data/README.md +153 -15
  4. data/lib/action_controller/serialization.rb +11 -1
  5. data/lib/active_model/serializable_resource.rb +2 -0
  6. data/lib/active_model/serializer.rb +275 -81
  7. data/lib/active_model/serializer/adapter.rb +2 -0
  8. data/lib/active_model/serializer/adapter/attributes.rb +2 -0
  9. data/lib/active_model/serializer/adapter/base.rb +2 -0
  10. data/lib/active_model/serializer/adapter/json.rb +2 -0
  11. data/lib/active_model/serializer/adapter/json_api.rb +2 -0
  12. data/lib/active_model/serializer/adapter/null.rb +2 -0
  13. data/lib/active_model/serializer/array_serializer.rb +2 -0
  14. data/lib/active_model/serializer/association.rb +53 -14
  15. data/lib/active_model/serializer/attribute.rb +2 -0
  16. data/lib/active_model/serializer/belongs_to_reflection.rb +7 -1
  17. data/lib/active_model/serializer/collection_serializer.rb +8 -5
  18. data/lib/active_model/serializer/concerns/caching.rb +36 -23
  19. data/lib/active_model/serializer/error_serializer.rb +2 -0
  20. data/lib/active_model/serializer/errors_serializer.rb +2 -0
  21. data/lib/active_model/serializer/field.rb +2 -0
  22. data/lib/active_model/serializer/fieldset.rb +3 -1
  23. data/lib/active_model/serializer/has_many_reflection.rb +6 -1
  24. data/lib/active_model/serializer/has_one_reflection.rb +3 -1
  25. data/lib/active_model/serializer/lazy_association.rb +99 -0
  26. data/lib/active_model/serializer/link.rb +23 -0
  27. data/lib/active_model/serializer/lint.rb +2 -0
  28. data/lib/active_model/serializer/null.rb +2 -0
  29. data/lib/active_model/serializer/reflection.rb +122 -73
  30. data/lib/active_model/serializer/version.rb +3 -1
  31. data/lib/active_model_serializers.rb +29 -11
  32. data/lib/active_model_serializers/adapter.rb +3 -1
  33. data/lib/active_model_serializers/adapter/attributes.rb +23 -0
  34. data/lib/active_model_serializers/adapter/base.rb +4 -2
  35. data/lib/active_model_serializers/adapter/json.rb +2 -0
  36. data/lib/active_model_serializers/adapter/json_api.rb +44 -26
  37. data/lib/active_model_serializers/adapter/json_api/deserialization.rb +4 -2
  38. data/lib/active_model_serializers/adapter/json_api/error.rb +2 -0
  39. data/lib/active_model_serializers/adapter/json_api/jsonapi.rb +2 -0
  40. data/lib/active_model_serializers/adapter/json_api/link.rb +2 -0
  41. data/lib/active_model_serializers/adapter/json_api/meta.rb +2 -0
  42. data/lib/active_model_serializers/adapter/json_api/pagination_links.rb +42 -21
  43. data/lib/active_model_serializers/adapter/json_api/relationship.rb +52 -9
  44. data/lib/active_model_serializers/adapter/json_api/resource_identifier.rb +35 -18
  45. data/lib/active_model_serializers/adapter/null.rb +2 -0
  46. data/lib/active_model_serializers/callbacks.rb +2 -0
  47. data/lib/active_model_serializers/deprecate.rb +2 -0
  48. data/lib/active_model_serializers/deserialization.rb +2 -0
  49. data/lib/active_model_serializers/json_pointer.rb +2 -0
  50. data/lib/active_model_serializers/logging.rb +2 -0
  51. data/lib/active_model_serializers/lookup_chain.rb +2 -0
  52. data/lib/active_model_serializers/model.rb +111 -30
  53. data/lib/active_model_serializers/model/caching.rb +25 -0
  54. data/lib/active_model_serializers/railtie.rb +4 -0
  55. data/lib/active_model_serializers/register_jsonapi_renderer.rb +2 -0
  56. data/lib/active_model_serializers/serializable_resource.rb +4 -2
  57. data/lib/active_model_serializers/serialization_context.rb +2 -0
  58. data/lib/active_model_serializers/test.rb +2 -0
  59. data/lib/active_model_serializers/test/schema.rb +4 -2
  60. data/lib/active_model_serializers/test/serializer.rb +2 -0
  61. data/lib/generators/rails/resource_override.rb +3 -1
  62. data/lib/generators/rails/serializer_generator.rb +2 -0
  63. data/lib/grape/active_model_serializers.rb +2 -0
  64. data/lib/grape/formatters/active_model_serializers.rb +2 -0
  65. data/lib/grape/helpers/active_model_serializers.rb +2 -0
  66. data/lib/tasks/rubocop.rake +55 -0
  67. metadata +74 -291
  68. data/.github/ISSUE_TEMPLATE.md +0 -29
  69. data/.github/PULL_REQUEST_TEMPLATE.md +0 -15
  70. data/.gitignore +0 -35
  71. data/.rubocop.yml +0 -102
  72. data/.simplecov +0 -110
  73. data/.travis.yml +0 -51
  74. data/CODE_OF_CONDUCT.md +0 -74
  75. data/CONTRIBUTING.md +0 -105
  76. data/Gemfile +0 -56
  77. data/Rakefile +0 -103
  78. data/active_model_serializers.gemspec +0 -62
  79. data/appveyor.yml +0 -24
  80. data/bin/bench +0 -171
  81. data/bin/bench_regression +0 -316
  82. data/bin/serve_benchmark +0 -39
  83. data/docs/ARCHITECTURE.md +0 -125
  84. data/docs/README.md +0 -42
  85. data/docs/STYLE.md +0 -58
  86. data/docs/general/adapters.md +0 -247
  87. data/docs/general/caching.md +0 -58
  88. data/docs/general/configuration_options.md +0 -169
  89. data/docs/general/deserialization.md +0 -100
  90. data/docs/general/fields.md +0 -31
  91. data/docs/general/getting_started.md +0 -133
  92. data/docs/general/instrumentation.md +0 -40
  93. data/docs/general/key_transforms.md +0 -40
  94. data/docs/general/logging.md +0 -14
  95. data/docs/general/rendering.md +0 -294
  96. data/docs/general/serializers.md +0 -461
  97. data/docs/how-open-source-maintained.jpg +0 -0
  98. data/docs/howto/add_pagination_links.md +0 -138
  99. data/docs/howto/add_relationship_links.md +0 -137
  100. data/docs/howto/add_root_key.md +0 -55
  101. data/docs/howto/grape_integration.md +0 -42
  102. data/docs/howto/outside_controller_use.md +0 -65
  103. data/docs/howto/passing_arbitrary_options.md +0 -27
  104. data/docs/howto/serialize_poro.md +0 -32
  105. data/docs/howto/test.md +0 -154
  106. data/docs/howto/upgrade_from_0_8_to_0_10.md +0 -265
  107. data/docs/integrations/ember-and-json-api.md +0 -144
  108. data/docs/integrations/grape.md +0 -19
  109. data/docs/jsonapi/errors.md +0 -56
  110. data/docs/jsonapi/schema.md +0 -151
  111. data/docs/jsonapi/schema/schema.json +0 -366
  112. data/docs/rfcs/0000-namespace.md +0 -106
  113. data/docs/rfcs/template.md +0 -15
  114. data/lib/active_model/serializer/collection_reflection.rb +0 -7
  115. data/lib/active_model/serializer/concerns/associations.rb +0 -102
  116. data/lib/active_model/serializer/concerns/attributes.rb +0 -82
  117. data/lib/active_model/serializer/concerns/configuration.rb +0 -59
  118. data/lib/active_model/serializer/concerns/links.rb +0 -35
  119. data/lib/active_model/serializer/concerns/meta.rb +0 -29
  120. data/lib/active_model/serializer/concerns/type.rb +0 -25
  121. data/lib/active_model/serializer/singular_reflection.rb +0 -7
  122. data/lib/active_model_serializers/key_transform.rb +0 -74
  123. data/test/action_controller/adapter_selector_test.rb +0 -53
  124. data/test/action_controller/explicit_serializer_test.rb +0 -135
  125. data/test/action_controller/json/include_test.rb +0 -246
  126. data/test/action_controller/json_api/deserialization_test.rb +0 -112
  127. data/test/action_controller/json_api/errors_test.rb +0 -40
  128. data/test/action_controller/json_api/fields_test.rb +0 -57
  129. data/test/action_controller/json_api/linked_test.rb +0 -202
  130. data/test/action_controller/json_api/pagination_test.rb +0 -116
  131. data/test/action_controller/json_api/transform_test.rb +0 -181
  132. data/test/action_controller/lookup_proc_test.rb +0 -49
  133. data/test/action_controller/namespace_lookup_test.rb +0 -226
  134. data/test/action_controller/serialization_scope_name_test.rb +0 -229
  135. data/test/action_controller/serialization_test.rb +0 -472
  136. data/test/active_model_serializers/adapter_for_test.rb +0 -208
  137. data/test/active_model_serializers/json_pointer_test.rb +0 -22
  138. data/test/active_model_serializers/key_transform_test.rb +0 -297
  139. data/test/active_model_serializers/logging_test.rb +0 -77
  140. data/test/active_model_serializers/model_test.rb +0 -22
  141. data/test/active_model_serializers/railtie_test_isolated.rb +0 -63
  142. data/test/active_model_serializers/register_jsonapi_renderer_test_isolated.rb +0 -143
  143. data/test/active_model_serializers/serialization_context_test_isolated.rb +0 -71
  144. data/test/active_model_serializers/test/schema_test.rb +0 -130
  145. data/test/active_model_serializers/test/serializer_test.rb +0 -62
  146. data/test/active_record_test.rb +0 -9
  147. data/test/adapter/attributes_test.rb +0 -43
  148. data/test/adapter/deprecation_test.rb +0 -100
  149. data/test/adapter/json/belongs_to_test.rb +0 -45
  150. data/test/adapter/json/collection_test.rb +0 -104
  151. data/test/adapter/json/has_many_test.rb +0 -45
  152. data/test/adapter/json/transform_test.rb +0 -93
  153. data/test/adapter/json_api/belongs_to_test.rb +0 -155
  154. data/test/adapter/json_api/collection_test.rb +0 -96
  155. data/test/adapter/json_api/errors_test.rb +0 -76
  156. data/test/adapter/json_api/fields_test.rb +0 -88
  157. data/test/adapter/json_api/has_many_embed_ids_test.rb +0 -43
  158. data/test/adapter/json_api/has_many_explicit_serializer_test.rb +0 -96
  159. data/test/adapter/json_api/has_many_test.rb +0 -165
  160. data/test/adapter/json_api/has_one_test.rb +0 -80
  161. data/test/adapter/json_api/include_data_if_sideloaded_test.rb +0 -166
  162. data/test/adapter/json_api/json_api_test.rb +0 -33
  163. data/test/adapter/json_api/linked_test.rb +0 -413
  164. data/test/adapter/json_api/links_test.rb +0 -95
  165. data/test/adapter/json_api/pagination_links_test.rb +0 -193
  166. data/test/adapter/json_api/parse_test.rb +0 -137
  167. data/test/adapter/json_api/relationship_test.rb +0 -397
  168. data/test/adapter/json_api/resource_identifier_test.rb +0 -110
  169. data/test/adapter/json_api/resource_meta_test.rb +0 -100
  170. data/test/adapter/json_api/toplevel_jsonapi_test.rb +0 -82
  171. data/test/adapter/json_api/transform_test.rb +0 -504
  172. data/test/adapter/json_api/type_test.rb +0 -61
  173. data/test/adapter/json_test.rb +0 -46
  174. data/test/adapter/null_test.rb +0 -22
  175. data/test/adapter/polymorphic_test.rb +0 -171
  176. data/test/adapter_test.rb +0 -67
  177. data/test/array_serializer_test.rb +0 -22
  178. data/test/benchmark/app.rb +0 -65
  179. data/test/benchmark/benchmarking_support.rb +0 -67
  180. data/test/benchmark/bm_active_record.rb +0 -81
  181. data/test/benchmark/bm_adapter.rb +0 -38
  182. data/test/benchmark/bm_caching.rb +0 -119
  183. data/test/benchmark/bm_lookup_chain.rb +0 -83
  184. data/test/benchmark/bm_transform.rb +0 -45
  185. data/test/benchmark/config.ru +0 -3
  186. data/test/benchmark/controllers.rb +0 -83
  187. data/test/benchmark/fixtures.rb +0 -219
  188. data/test/cache_test.rb +0 -579
  189. data/test/collection_serializer_test.rb +0 -110
  190. data/test/fixtures/active_record.rb +0 -78
  191. data/test/fixtures/poro.rb +0 -286
  192. data/test/generators/scaffold_controller_generator_test.rb +0 -24
  193. data/test/generators/serializer_generator_test.rb +0 -74
  194. data/test/grape_test.rb +0 -178
  195. data/test/lint_test.rb +0 -49
  196. data/test/logger_test.rb +0 -20
  197. data/test/poro_test.rb +0 -9
  198. data/test/serializable_resource_test.rb +0 -79
  199. data/test/serializers/association_macros_test.rb +0 -37
  200. data/test/serializers/associations_test.rb +0 -370
  201. data/test/serializers/attribute_test.rb +0 -151
  202. data/test/serializers/attributes_test.rb +0 -52
  203. data/test/serializers/caching_configuration_test_isolated.rb +0 -170
  204. data/test/serializers/configuration_test.rb +0 -32
  205. data/test/serializers/fieldset_test.rb +0 -14
  206. data/test/serializers/meta_test.rb +0 -202
  207. data/test/serializers/options_test.rb +0 -21
  208. data/test/serializers/read_attribute_for_serialization_test.rb +0 -79
  209. data/test/serializers/root_test.rb +0 -21
  210. data/test/serializers/serialization_test.rb +0 -55
  211. data/test/serializers/serializer_for_test.rb +0 -136
  212. data/test/serializers/serializer_for_with_namespace_test.rb +0 -87
  213. data/test/support/custom_schemas/active_model_serializers/test/schema_test/my/index.json +0 -6
  214. data/test/support/isolated_unit.rb +0 -82
  215. data/test/support/rails5_shims.rb +0 -53
  216. data/test/support/rails_app.rb +0 -36
  217. data/test/support/schemas/active_model_serializers/test/schema_test/my/index.json +0 -6
  218. data/test/support/schemas/active_model_serializers/test/schema_test/my/show.json +0 -6
  219. data/test/support/schemas/custom/show.json +0 -7
  220. data/test/support/schemas/hyper_schema.json +0 -93
  221. data/test/support/schemas/render_using_json_api.json +0 -43
  222. data/test/support/schemas/simple_json_pointers.json +0 -10
  223. data/test/support/serialization_testing.rb +0 -71
  224. data/test/test_helper.rb +0 -58
@@ -0,0 +1,25 @@
1
+ module ActiveModelSerializers
2
+ class Model
3
+ module Caching
4
+ extend ActiveSupport::Concern
5
+
6
+ included do
7
+ attr_writer :updated_at
8
+ attributes :id
9
+ end
10
+
11
+ # Defaults to the downcased model name and updated_at
12
+ def cache_key
13
+ ActiveSupport::Cache.expand_cache_key([
14
+ self.class.model_name.name.downcase,
15
+ "#{id}-#{updated_at.strftime('%Y%m%d%H%M%S%9N')}"
16
+ ].compact)
17
+ end
18
+
19
+ # Defaults to the time the serializer file was modified.
20
+ def updated_at
21
+ defined?(@updated_at) ? @updated_at : File.mtime(__FILE__)
22
+ end
23
+ end
24
+ end
25
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rails/railtie'
2
4
  require 'action_controller'
3
5
  require 'action_controller/railtie'
@@ -5,6 +7,8 @@ require 'action_controller/serialization'
5
7
 
6
8
  module ActiveModelSerializers
7
9
  class Railtie < Rails::Railtie
10
+ config.eager_load_namespaces << ActiveModelSerializers
11
+
8
12
  config.to_prepare do
9
13
  ActiveModel::Serializer.serializers_cache.clear
10
14
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Based on discussion in https://github.com/rails/rails/pull/23712#issuecomment-184977238,
2
4
  # the JSON API media type will have its own format/renderer.
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'set'
2
4
 
3
5
  module ActiveModelSerializers
@@ -14,8 +16,8 @@ module ActiveModelSerializers
14
16
  # @return the serializable_resource, ready for #as_json/#to_json/#serializable_hash.
15
17
  def initialize(resource, options = {})
16
18
  @resource = resource
17
- @adapter_opts, @serializer_opts =
18
- options.partition { |k, _| ADAPTER_OPTION_KEYS.include? k }.map { |h| Hash[h] }
19
+ @adapter_opts = options.select { |k, _| ADAPTER_OPTION_KEYS.include? k }
20
+ @serializer_opts = options.reject { |k, _| ADAPTER_OPTION_KEYS.include? k }
19
21
  end
20
22
 
21
23
  def serialization_scope=(scope)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_support/core_ext/array/extract_options'
2
4
  module ActiveModelSerializers
3
5
  class SerializationContext
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModelSerializers
2
4
  module Test
3
5
  extend ActiveSupport::Autoload
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModelSerializers
2
4
  module Test
3
5
  module Schema
@@ -60,11 +62,11 @@ module ActiveModelSerializers
60
62
  attr_reader :document_store
61
63
 
62
64
  def controller_path
63
- request.filtered_parameters[:controller]
65
+ request.filtered_parameters.with_indifferent_access[:controller]
64
66
  end
65
67
 
66
68
  def action
67
- request.filtered_parameters[:action]
69
+ request.filtered_parameters.with_indifferent_access[:action]
68
70
  end
69
71
 
70
72
  def schema_directory
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'set'
2
4
  module ActiveModelSerializers
3
5
  module Test
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rails/generators'
2
4
  require 'rails/generators/rails/resource/resource_generator'
3
5
 
4
6
  module Rails
5
7
  module Generators
6
8
  class ResourceGenerator
7
- hook_for :serializer, default: true, boolean: true
9
+ hook_for :serializer, default: true, type: :boolean
8
10
  end
9
11
  end
10
12
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Rails
2
4
  module Generators
3
5
  class SerializerGenerator < NamedBase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # To add Grape support, require 'grape/active_model_serializers' in the base of your Grape endpoints
2
4
  # Then add 'include Grape::ActiveModelSerializers' to enable the formatter and helpers
3
5
  require 'active_model_serializers'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # A Grape response formatter that can be used as 'formatter :json, Grape::Formatters::ActiveModelSerializers'
2
4
  #
3
5
  # Serializer options can be passed as a hash from your Grape endpoint using env[:active_model_serializer_options],
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Helpers can be included in your Grape endpoint as: helpers Grape::Helpers::ActiveModelSerializers
2
4
 
3
5
  module Grape
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ begin
4
+ require 'rubocop'
5
+ require 'rubocop/rake_task'
6
+ rescue LoadError # rubocop:disable Lint/HandleExceptions
7
+ else
8
+ require 'rbconfig'
9
+ # https://github.com/bundler/bundler/blob/1b3eb2465a/lib/bundler/constants.rb#L2
10
+ windows_platforms = /(msdos|mswin|djgpp|mingw)/
11
+ if RbConfig::CONFIG['host_os'] =~ windows_platforms
12
+ desc 'No-op rubocop on Windows-- unsupported platform'
13
+ task :rubocop do
14
+ puts 'Skipping rubocop on Windows'
15
+ end
16
+ elsif defined?(::Rubinius)
17
+ desc 'No-op rubocop to avoid rbx segfault'
18
+ task :rubocop do
19
+ puts 'Skipping rubocop on rbx due to segfault'
20
+ puts 'https://github.com/rubinius/rubinius/issues/3499'
21
+ end
22
+ else
23
+ Rake::Task[:rubocop].clear if Rake::Task.task_defined?(:rubocop)
24
+ patterns = [
25
+ 'Gemfile',
26
+ 'Rakefile',
27
+ 'lib/**/*.{rb,rake}',
28
+ 'config/**/*.rb',
29
+ 'app/**/*.rb',
30
+ 'test/**/*.rb'
31
+ ]
32
+ desc 'Execute rubocop'
33
+ RuboCop::RakeTask.new(:rubocop) do |task|
34
+ task.options = ['--rails', '--display-cop-names', '--display-style-guide']
35
+ task.formatters = ['progress']
36
+ task.patterns = patterns
37
+ task.fail_on_error = true
38
+ end
39
+
40
+ namespace :rubocop do
41
+ desc 'Auto-gen rubocop config'
42
+ task :auto_gen_config do
43
+ options = ['--auto-gen-config'].concat patterns
44
+ require 'benchmark'
45
+ result = 0
46
+ cli = RuboCop::CLI.new
47
+ time = Benchmark.realtime do
48
+ result = cli.run(options)
49
+ end
50
+ puts "Finished in #{time} seconds" if cli.options[:debug]
51
+ abort('RuboCop failed!') if result.nonzero?
52
+ end
53
+ end
54
+ end
55
+ end
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.3
4
+ version: 0.10.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Klabnik
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-21 00:00:00.000000000 Z
11
+ date: 2020-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '4.1'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '6'
22
+ version: '6.2'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '4.1'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '6'
32
+ version: '6.2'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: actionpack
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -39,7 +39,7 @@ dependencies:
39
39
  version: '4.1'
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
- version: '6'
42
+ version: '6.2'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -49,7 +49,7 @@ dependencies:
49
49
  version: '4.1'
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
- version: '6'
52
+ version: '6.2'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: railties
55
55
  requirement: !ruby/object:Gem::Requirement
@@ -59,7 +59,7 @@ dependencies:
59
59
  version: '4.1'
60
60
  - - "<"
61
61
  - !ruby/object:Gem::Version
62
- version: '6'
62
+ version: '6.2'
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
@@ -69,21 +69,61 @@ dependencies:
69
69
  version: '4.1'
70
70
  - - "<"
71
71
  - !ruby/object:Gem::Version
72
- version: '6'
72
+ version: '6.2'
73
73
  - !ruby/object:Gem::Dependency
74
- name: jsonapi
74
+ name: minitest
75
75
  requirement: !ruby/object:Gem::Requirement
76
76
  requirements:
77
- - - '='
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
+ - - ">="
78
108
  - !ruby/object:Gem::Version
79
- version: 0.1.1.beta2
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'
80
120
  type: :runtime
81
121
  prerelease: false
82
122
  version_requirements: !ruby/object:Gem::Requirement
83
123
  requirements:
84
- - - '='
124
+ - - ">="
85
125
  - !ruby/object:Gem::Version
86
- version: 0.1.1.beta2
126
+ version: '0.2'
87
127
  - !ruby/object:Gem::Dependency
88
128
  name: activerecord
89
129
  requirement: !ruby/object:Gem::Requirement
@@ -93,7 +133,7 @@ dependencies:
93
133
  version: '4.1'
94
134
  - - "<"
95
135
  - !ruby/object:Gem::Version
96
- version: '6'
136
+ version: '6.2'
97
137
  type: :development
98
138
  prerelease: false
99
139
  version_requirements: !ruby/object:Gem::Requirement
@@ -103,7 +143,7 @@ dependencies:
103
143
  version: '4.1'
104
144
  - - "<"
105
145
  - !ruby/object:Gem::Version
106
- version: '6'
146
+ version: '6.2'
107
147
  - !ruby/object:Gem::Dependency
108
148
  name: kaminari
109
149
  requirement: !ruby/object:Gem::Requirement
@@ -142,28 +182,28 @@ dependencies:
142
182
  name: bundler
143
183
  requirement: !ruby/object:Gem::Requirement
144
184
  requirements:
145
- - - "~>"
185
+ - - ">="
146
186
  - !ruby/object:Gem::Version
147
- version: '1.6'
187
+ version: '0'
148
188
  type: :development
149
189
  prerelease: false
150
190
  version_requirements: !ruby/object:Gem::Requirement
151
191
  requirements:
152
- - - "~>"
192
+ - - ">="
153
193
  - !ruby/object:Gem::Version
154
- version: '1.6'
194
+ version: '0'
155
195
  - !ruby/object:Gem::Dependency
156
196
  name: simplecov
157
197
  requirement: !ruby/object:Gem::Requirement
158
198
  requirements:
159
- - - "~>"
199
+ - - ">="
160
200
  - !ruby/object:Gem::Version
161
201
  version: '0.11'
162
202
  type: :development
163
203
  prerelease: false
164
204
  version_requirements: !ruby/object:Gem::Requirement
165
205
  requirements:
166
- - - "~>"
206
+ - - ">="
167
207
  - !ruby/object:Gem::Version
168
208
  version: '0.11'
169
209
  - !ruby/object:Gem::Dependency
@@ -189,7 +229,7 @@ dependencies:
189
229
  version: '0.13'
190
230
  - - "<"
191
231
  - !ruby/object:Gem::Version
192
- version: '1.0'
232
+ version: 0.19.1
193
233
  type: :development
194
234
  prerelease: false
195
235
  version_requirements: !ruby/object:Gem::Requirement
@@ -199,7 +239,7 @@ dependencies:
199
239
  version: '0.13'
200
240
  - - "<"
201
241
  - !ruby/object:Gem::Version
202
- version: '1.0'
242
+ version: 0.19.1
203
243
  - !ruby/object:Gem::Dependency
204
244
  name: json_schema
205
245
  requirement: !ruby/object:Gem::Requirement
@@ -223,7 +263,7 @@ dependencies:
223
263
  version: '10.0'
224
264
  - - "<"
225
265
  - !ruby/object:Gem::Version
226
- version: '12.0'
266
+ version: '13.0'
227
267
  type: :development
228
268
  prerelease: false
229
269
  version_requirements: !ruby/object:Gem::Requirement
@@ -233,7 +273,7 @@ dependencies:
233
273
  version: '10.0'
234
274
  - - "<"
235
275
  - !ruby/object:Gem::Version
236
- version: '12.0'
276
+ version: '13.0'
237
277
  description: ActiveModel::Serializers allows you to generate your JSON in an object-oriented
238
278
  and convention-driven manner.
239
279
  email:
@@ -242,55 +282,9 @@ executables: []
242
282
  extensions: []
243
283
  extra_rdoc_files: []
244
284
  files:
245
- - ".github/ISSUE_TEMPLATE.md"
246
- - ".github/PULL_REQUEST_TEMPLATE.md"
247
- - ".gitignore"
248
- - ".rubocop.yml"
249
- - ".simplecov"
250
- - ".travis.yml"
251
285
  - CHANGELOG.md
252
- - CODE_OF_CONDUCT.md
253
- - CONTRIBUTING.md
254
- - Gemfile
255
286
  - MIT-LICENSE
256
287
  - README.md
257
- - Rakefile
258
- - active_model_serializers.gemspec
259
- - appveyor.yml
260
- - bin/bench
261
- - bin/bench_regression
262
- - bin/serve_benchmark
263
- - docs/ARCHITECTURE.md
264
- - docs/README.md
265
- - docs/STYLE.md
266
- - docs/general/adapters.md
267
- - docs/general/caching.md
268
- - docs/general/configuration_options.md
269
- - docs/general/deserialization.md
270
- - docs/general/fields.md
271
- - docs/general/getting_started.md
272
- - docs/general/instrumentation.md
273
- - docs/general/key_transforms.md
274
- - docs/general/logging.md
275
- - docs/general/rendering.md
276
- - docs/general/serializers.md
277
- - docs/how-open-source-maintained.jpg
278
- - docs/howto/add_pagination_links.md
279
- - docs/howto/add_relationship_links.md
280
- - docs/howto/add_root_key.md
281
- - docs/howto/grape_integration.md
282
- - docs/howto/outside_controller_use.md
283
- - docs/howto/passing_arbitrary_options.md
284
- - docs/howto/serialize_poro.md
285
- - docs/howto/test.md
286
- - docs/howto/upgrade_from_0_8_to_0_10.md
287
- - docs/integrations/ember-and-json-api.md
288
- - docs/integrations/grape.md
289
- - docs/jsonapi/errors.md
290
- - docs/jsonapi/schema.md
291
- - docs/jsonapi/schema/schema.json
292
- - docs/rfcs/0000-namespace.md
293
- - docs/rfcs/template.md
294
288
  - lib/action_controller/serialization.rb
295
289
  - lib/active_model/serializable_resource.rb
296
290
  - lib/active_model/serializer.rb
@@ -304,25 +298,19 @@ files:
304
298
  - lib/active_model/serializer/association.rb
305
299
  - lib/active_model/serializer/attribute.rb
306
300
  - lib/active_model/serializer/belongs_to_reflection.rb
307
- - lib/active_model/serializer/collection_reflection.rb
308
301
  - lib/active_model/serializer/collection_serializer.rb
309
- - lib/active_model/serializer/concerns/associations.rb
310
- - lib/active_model/serializer/concerns/attributes.rb
311
302
  - lib/active_model/serializer/concerns/caching.rb
312
- - lib/active_model/serializer/concerns/configuration.rb
313
- - lib/active_model/serializer/concerns/links.rb
314
- - lib/active_model/serializer/concerns/meta.rb
315
- - lib/active_model/serializer/concerns/type.rb
316
303
  - lib/active_model/serializer/error_serializer.rb
317
304
  - lib/active_model/serializer/errors_serializer.rb
318
305
  - lib/active_model/serializer/field.rb
319
306
  - lib/active_model/serializer/fieldset.rb
320
307
  - lib/active_model/serializer/has_many_reflection.rb
321
308
  - lib/active_model/serializer/has_one_reflection.rb
309
+ - lib/active_model/serializer/lazy_association.rb
310
+ - lib/active_model/serializer/link.rb
322
311
  - lib/active_model/serializer/lint.rb
323
312
  - lib/active_model/serializer/null.rb
324
313
  - lib/active_model/serializer/reflection.rb
325
- - lib/active_model/serializer/singular_reflection.rb
326
314
  - lib/active_model/serializer/version.rb
327
315
  - lib/active_model_serializers.rb
328
316
  - lib/active_model_serializers/adapter.rb
@@ -343,10 +331,10 @@ files:
343
331
  - lib/active_model_serializers/deprecate.rb
344
332
  - lib/active_model_serializers/deserialization.rb
345
333
  - lib/active_model_serializers/json_pointer.rb
346
- - lib/active_model_serializers/key_transform.rb
347
334
  - lib/active_model_serializers/logging.rb
348
335
  - lib/active_model_serializers/lookup_chain.rb
349
336
  - lib/active_model_serializers/model.rb
337
+ - lib/active_model_serializers/model/caching.rb
350
338
  - lib/active_model_serializers/railtie.rb
351
339
  - lib/active_model_serializers/register_jsonapi_renderer.rb
352
340
  - lib/active_model_serializers/serializable_resource.rb
@@ -361,113 +349,12 @@ files:
361
349
  - lib/grape/active_model_serializers.rb
362
350
  - lib/grape/formatters/active_model_serializers.rb
363
351
  - lib/grape/helpers/active_model_serializers.rb
364
- - test/action_controller/adapter_selector_test.rb
365
- - test/action_controller/explicit_serializer_test.rb
366
- - test/action_controller/json/include_test.rb
367
- - test/action_controller/json_api/deserialization_test.rb
368
- - test/action_controller/json_api/errors_test.rb
369
- - test/action_controller/json_api/fields_test.rb
370
- - test/action_controller/json_api/linked_test.rb
371
- - test/action_controller/json_api/pagination_test.rb
372
- - test/action_controller/json_api/transform_test.rb
373
- - test/action_controller/lookup_proc_test.rb
374
- - test/action_controller/namespace_lookup_test.rb
375
- - test/action_controller/serialization_scope_name_test.rb
376
- - test/action_controller/serialization_test.rb
377
- - test/active_model_serializers/adapter_for_test.rb
378
- - test/active_model_serializers/json_pointer_test.rb
379
- - test/active_model_serializers/key_transform_test.rb
380
- - test/active_model_serializers/logging_test.rb
381
- - test/active_model_serializers/model_test.rb
382
- - test/active_model_serializers/railtie_test_isolated.rb
383
- - test/active_model_serializers/register_jsonapi_renderer_test_isolated.rb
384
- - test/active_model_serializers/serialization_context_test_isolated.rb
385
- - test/active_model_serializers/test/schema_test.rb
386
- - test/active_model_serializers/test/serializer_test.rb
387
- - test/active_record_test.rb
388
- - test/adapter/attributes_test.rb
389
- - test/adapter/deprecation_test.rb
390
- - test/adapter/json/belongs_to_test.rb
391
- - test/adapter/json/collection_test.rb
392
- - test/adapter/json/has_many_test.rb
393
- - test/adapter/json/transform_test.rb
394
- - test/adapter/json_api/belongs_to_test.rb
395
- - test/adapter/json_api/collection_test.rb
396
- - test/adapter/json_api/errors_test.rb
397
- - test/adapter/json_api/fields_test.rb
398
- - test/adapter/json_api/has_many_embed_ids_test.rb
399
- - test/adapter/json_api/has_many_explicit_serializer_test.rb
400
- - test/adapter/json_api/has_many_test.rb
401
- - test/adapter/json_api/has_one_test.rb
402
- - test/adapter/json_api/include_data_if_sideloaded_test.rb
403
- - test/adapter/json_api/json_api_test.rb
404
- - test/adapter/json_api/linked_test.rb
405
- - test/adapter/json_api/links_test.rb
406
- - test/adapter/json_api/pagination_links_test.rb
407
- - test/adapter/json_api/parse_test.rb
408
- - test/adapter/json_api/relationship_test.rb
409
- - test/adapter/json_api/resource_identifier_test.rb
410
- - test/adapter/json_api/resource_meta_test.rb
411
- - test/adapter/json_api/toplevel_jsonapi_test.rb
412
- - test/adapter/json_api/transform_test.rb
413
- - test/adapter/json_api/type_test.rb
414
- - test/adapter/json_test.rb
415
- - test/adapter/null_test.rb
416
- - test/adapter/polymorphic_test.rb
417
- - test/adapter_test.rb
418
- - test/array_serializer_test.rb
419
- - test/benchmark/app.rb
420
- - test/benchmark/benchmarking_support.rb
421
- - test/benchmark/bm_active_record.rb
422
- - test/benchmark/bm_adapter.rb
423
- - test/benchmark/bm_caching.rb
424
- - test/benchmark/bm_lookup_chain.rb
425
- - test/benchmark/bm_transform.rb
426
- - test/benchmark/config.ru
427
- - test/benchmark/controllers.rb
428
- - test/benchmark/fixtures.rb
429
- - test/cache_test.rb
430
- - test/collection_serializer_test.rb
431
- - test/fixtures/active_record.rb
432
- - test/fixtures/poro.rb
433
- - test/generators/scaffold_controller_generator_test.rb
434
- - test/generators/serializer_generator_test.rb
435
- - test/grape_test.rb
436
- - test/lint_test.rb
437
- - test/logger_test.rb
438
- - test/poro_test.rb
439
- - test/serializable_resource_test.rb
440
- - test/serializers/association_macros_test.rb
441
- - test/serializers/associations_test.rb
442
- - test/serializers/attribute_test.rb
443
- - test/serializers/attributes_test.rb
444
- - test/serializers/caching_configuration_test_isolated.rb
445
- - test/serializers/configuration_test.rb
446
- - test/serializers/fieldset_test.rb
447
- - test/serializers/meta_test.rb
448
- - test/serializers/options_test.rb
449
- - test/serializers/read_attribute_for_serialization_test.rb
450
- - test/serializers/root_test.rb
451
- - test/serializers/serialization_test.rb
452
- - test/serializers/serializer_for_test.rb
453
- - test/serializers/serializer_for_with_namespace_test.rb
454
- - test/support/custom_schemas/active_model_serializers/test/schema_test/my/index.json
455
- - test/support/isolated_unit.rb
456
- - test/support/rails5_shims.rb
457
- - test/support/rails_app.rb
458
- - test/support/schemas/active_model_serializers/test/schema_test/my/index.json
459
- - test/support/schemas/active_model_serializers/test/schema_test/my/show.json
460
- - test/support/schemas/custom/show.json
461
- - test/support/schemas/hyper_schema.json
462
- - test/support/schemas/render_using_json_api.json
463
- - test/support/schemas/simple_json_pointers.json
464
- - test/support/serialization_testing.rb
465
- - test/test_helper.rb
352
+ - lib/tasks/rubocop.rake
466
353
  homepage: https://github.com/rails-api/active_model_serializers
467
354
  licenses:
468
355
  - MIT
469
356
  metadata: {}
470
- post_install_message:
357
+ post_install_message:
471
358
  rdoc_options: []
472
359
  require_paths:
473
360
  - lib
@@ -482,112 +369,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
482
369
  - !ruby/object:Gem::Version
483
370
  version: '0'
484
371
  requirements: []
485
- rubyforge_project:
486
- rubygems_version: 2.4.8
487
- signing_key:
372
+ rubygems_version: 3.1.4
373
+ signing_key:
488
374
  specification_version: 4
489
375
  summary: Conventions-based JSON generation for Rails.
490
- test_files:
491
- - test/action_controller/adapter_selector_test.rb
492
- - test/action_controller/explicit_serializer_test.rb
493
- - test/action_controller/json/include_test.rb
494
- - test/action_controller/json_api/deserialization_test.rb
495
- - test/action_controller/json_api/errors_test.rb
496
- - test/action_controller/json_api/fields_test.rb
497
- - test/action_controller/json_api/linked_test.rb
498
- - test/action_controller/json_api/pagination_test.rb
499
- - test/action_controller/json_api/transform_test.rb
500
- - test/action_controller/lookup_proc_test.rb
501
- - test/action_controller/namespace_lookup_test.rb
502
- - test/action_controller/serialization_scope_name_test.rb
503
- - test/action_controller/serialization_test.rb
504
- - test/active_model_serializers/adapter_for_test.rb
505
- - test/active_model_serializers/json_pointer_test.rb
506
- - test/active_model_serializers/key_transform_test.rb
507
- - test/active_model_serializers/logging_test.rb
508
- - test/active_model_serializers/model_test.rb
509
- - test/active_model_serializers/railtie_test_isolated.rb
510
- - test/active_model_serializers/register_jsonapi_renderer_test_isolated.rb
511
- - test/active_model_serializers/serialization_context_test_isolated.rb
512
- - test/active_model_serializers/test/schema_test.rb
513
- - test/active_model_serializers/test/serializer_test.rb
514
- - test/active_record_test.rb
515
- - test/adapter/attributes_test.rb
516
- - test/adapter/deprecation_test.rb
517
- - test/adapter/json/belongs_to_test.rb
518
- - test/adapter/json/collection_test.rb
519
- - test/adapter/json/has_many_test.rb
520
- - test/adapter/json/transform_test.rb
521
- - test/adapter/json_api/belongs_to_test.rb
522
- - test/adapter/json_api/collection_test.rb
523
- - test/adapter/json_api/errors_test.rb
524
- - test/adapter/json_api/fields_test.rb
525
- - test/adapter/json_api/has_many_embed_ids_test.rb
526
- - test/adapter/json_api/has_many_explicit_serializer_test.rb
527
- - test/adapter/json_api/has_many_test.rb
528
- - test/adapter/json_api/has_one_test.rb
529
- - test/adapter/json_api/include_data_if_sideloaded_test.rb
530
- - test/adapter/json_api/json_api_test.rb
531
- - test/adapter/json_api/linked_test.rb
532
- - test/adapter/json_api/links_test.rb
533
- - test/adapter/json_api/pagination_links_test.rb
534
- - test/adapter/json_api/parse_test.rb
535
- - test/adapter/json_api/relationship_test.rb
536
- - test/adapter/json_api/resource_identifier_test.rb
537
- - test/adapter/json_api/resource_meta_test.rb
538
- - test/adapter/json_api/toplevel_jsonapi_test.rb
539
- - test/adapter/json_api/transform_test.rb
540
- - test/adapter/json_api/type_test.rb
541
- - test/adapter/json_test.rb
542
- - test/adapter/null_test.rb
543
- - test/adapter/polymorphic_test.rb
544
- - test/adapter_test.rb
545
- - test/array_serializer_test.rb
546
- - test/benchmark/app.rb
547
- - test/benchmark/benchmarking_support.rb
548
- - test/benchmark/bm_active_record.rb
549
- - test/benchmark/bm_adapter.rb
550
- - test/benchmark/bm_caching.rb
551
- - test/benchmark/bm_lookup_chain.rb
552
- - test/benchmark/bm_transform.rb
553
- - test/benchmark/config.ru
554
- - test/benchmark/controllers.rb
555
- - test/benchmark/fixtures.rb
556
- - test/cache_test.rb
557
- - test/collection_serializer_test.rb
558
- - test/fixtures/active_record.rb
559
- - test/fixtures/poro.rb
560
- - test/generators/scaffold_controller_generator_test.rb
561
- - test/generators/serializer_generator_test.rb
562
- - test/grape_test.rb
563
- - test/lint_test.rb
564
- - test/logger_test.rb
565
- - test/poro_test.rb
566
- - test/serializable_resource_test.rb
567
- - test/serializers/association_macros_test.rb
568
- - test/serializers/associations_test.rb
569
- - test/serializers/attribute_test.rb
570
- - test/serializers/attributes_test.rb
571
- - test/serializers/caching_configuration_test_isolated.rb
572
- - test/serializers/configuration_test.rb
573
- - test/serializers/fieldset_test.rb
574
- - test/serializers/meta_test.rb
575
- - test/serializers/options_test.rb
576
- - test/serializers/read_attribute_for_serialization_test.rb
577
- - test/serializers/root_test.rb
578
- - test/serializers/serialization_test.rb
579
- - test/serializers/serializer_for_test.rb
580
- - test/serializers/serializer_for_with_namespace_test.rb
581
- - test/support/custom_schemas/active_model_serializers/test/schema_test/my/index.json
582
- - test/support/isolated_unit.rb
583
- - test/support/rails5_shims.rb
584
- - test/support/rails_app.rb
585
- - test/support/schemas/active_model_serializers/test/schema_test/my/index.json
586
- - test/support/schemas/active_model_serializers/test/schema_test/my/show.json
587
- - test/support/schemas/custom/show.json
588
- - test/support/schemas/hyper_schema.json
589
- - test/support/schemas/render_using_json_api.json
590
- - test/support/schemas/simple_json_pointers.json
591
- - test/support/serialization_testing.rb
592
- - test/test_helper.rb
593
- has_rdoc:
376
+ test_files: []