active_model_serializers 0.10.8 → 0.10.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +4 -0
  3. data/.travis.yml +12 -3
  4. data/CHANGELOG.md +14 -1
  5. data/Gemfile +3 -1
  6. data/Rakefile +2 -0
  7. data/active_model_serializers.gemspec +1 -0
  8. data/lib/action_controller/serialization.rb +2 -0
  9. data/lib/active_model/serializable_resource.rb +2 -0
  10. data/lib/active_model/serializer.rb +2 -0
  11. data/lib/active_model/serializer/adapter.rb +2 -0
  12. data/lib/active_model/serializer/adapter/attributes.rb +2 -0
  13. data/lib/active_model/serializer/adapter/base.rb +2 -0
  14. data/lib/active_model/serializer/adapter/json.rb +2 -0
  15. data/lib/active_model/serializer/adapter/json_api.rb +2 -0
  16. data/lib/active_model/serializer/adapter/null.rb +2 -0
  17. data/lib/active_model/serializer/array_serializer.rb +2 -0
  18. data/lib/active_model/serializer/association.rb +2 -0
  19. data/lib/active_model/serializer/attribute.rb +2 -0
  20. data/lib/active_model/serializer/belongs_to_reflection.rb +2 -0
  21. data/lib/active_model/serializer/collection_serializer.rb +2 -0
  22. data/lib/active_model/serializer/concerns/caching.rb +5 -1
  23. data/lib/active_model/serializer/error_serializer.rb +2 -0
  24. data/lib/active_model/serializer/errors_serializer.rb +2 -0
  25. data/lib/active_model/serializer/field.rb +2 -0
  26. data/lib/active_model/serializer/fieldset.rb +2 -0
  27. data/lib/active_model/serializer/has_many_reflection.rb +2 -0
  28. data/lib/active_model/serializer/has_one_reflection.rb +2 -0
  29. data/lib/active_model/serializer/lazy_association.rb +5 -2
  30. data/lib/active_model/serializer/link.rb +2 -0
  31. data/lib/active_model/serializer/lint.rb +2 -0
  32. data/lib/active_model/serializer/null.rb +2 -0
  33. data/lib/active_model/serializer/reflection.rb +2 -0
  34. data/lib/active_model/serializer/version.rb +3 -1
  35. data/lib/active_model_serializers.rb +2 -0
  36. data/lib/active_model_serializers/adapter.rb +3 -1
  37. data/lib/active_model_serializers/adapter/attributes.rb +2 -0
  38. data/lib/active_model_serializers/adapter/base.rb +2 -0
  39. data/lib/active_model_serializers/adapter/json.rb +2 -0
  40. data/lib/active_model_serializers/adapter/json_api.rb +2 -0
  41. data/lib/active_model_serializers/adapter/json_api/deserialization.rb +2 -0
  42. data/lib/active_model_serializers/adapter/json_api/error.rb +2 -0
  43. data/lib/active_model_serializers/adapter/json_api/jsonapi.rb +2 -0
  44. data/lib/active_model_serializers/adapter/json_api/link.rb +2 -0
  45. data/lib/active_model_serializers/adapter/json_api/meta.rb +2 -0
  46. data/lib/active_model_serializers/adapter/json_api/pagination_links.rb +2 -0
  47. data/lib/active_model_serializers/adapter/json_api/relationship.rb +2 -0
  48. data/lib/active_model_serializers/adapter/json_api/resource_identifier.rb +2 -0
  49. data/lib/active_model_serializers/adapter/null.rb +2 -0
  50. data/lib/active_model_serializers/callbacks.rb +2 -0
  51. data/lib/active_model_serializers/deprecate.rb +2 -0
  52. data/lib/active_model_serializers/deserialization.rb +2 -0
  53. data/lib/active_model_serializers/json_pointer.rb +2 -0
  54. data/lib/active_model_serializers/logging.rb +2 -0
  55. data/lib/active_model_serializers/lookup_chain.rb +2 -0
  56. data/lib/active_model_serializers/model.rb +2 -0
  57. data/lib/active_model_serializers/railtie.rb +2 -0
  58. data/lib/active_model_serializers/register_jsonapi_renderer.rb +2 -0
  59. data/lib/active_model_serializers/serializable_resource.rb +4 -2
  60. data/lib/active_model_serializers/serialization_context.rb +2 -0
  61. data/lib/active_model_serializers/test.rb +2 -0
  62. data/lib/active_model_serializers/test/schema.rb +2 -0
  63. data/lib/active_model_serializers/test/serializer.rb +2 -0
  64. data/lib/generators/rails/resource_override.rb +2 -0
  65. data/lib/generators/rails/serializer_generator.rb +2 -0
  66. data/lib/grape/active_model_serializers.rb +2 -0
  67. data/lib/grape/formatters/active_model_serializers.rb +2 -0
  68. data/lib/grape/helpers/active_model_serializers.rb +2 -0
  69. data/lib/tasks/rubocop.rake +2 -0
  70. data/test/action_controller/adapter_selector_test.rb +2 -0
  71. data/test/action_controller/explicit_serializer_test.rb +2 -0
  72. data/test/action_controller/json/include_test.rb +2 -0
  73. data/test/action_controller/json_api/deserialization_test.rb +2 -0
  74. data/test/action_controller/json_api/errors_test.rb +2 -0
  75. data/test/action_controller/json_api/fields_test.rb +2 -0
  76. data/test/action_controller/json_api/linked_test.rb +2 -0
  77. data/test/action_controller/json_api/pagination_test.rb +2 -0
  78. data/test/action_controller/json_api/transform_test.rb +2 -0
  79. data/test/action_controller/lookup_proc_test.rb +2 -0
  80. data/test/action_controller/namespace_lookup_test.rb +2 -0
  81. data/test/action_controller/serialization_scope_name_test.rb +2 -0
  82. data/test/action_controller/serialization_test.rb +2 -0
  83. data/test/active_model_serializers/adapter_for_test.rb +2 -0
  84. data/test/active_model_serializers/json_pointer_test.rb +2 -0
  85. data/test/active_model_serializers/logging_test.rb +2 -0
  86. data/test/active_model_serializers/model_test.rb +2 -0
  87. data/test/active_model_serializers/railtie_test_isolated.rb +2 -0
  88. data/test/active_model_serializers/register_jsonapi_renderer_test_isolated.rb +2 -0
  89. data/test/active_model_serializers/serialization_context_test_isolated.rb +2 -0
  90. data/test/active_model_serializers/test/schema_test.rb +2 -0
  91. data/test/active_model_serializers/test/serializer_test.rb +2 -0
  92. data/test/active_record_test.rb +2 -0
  93. data/test/adapter/attributes_test.rb +2 -0
  94. data/test/adapter/deprecation_test.rb +2 -0
  95. data/test/adapter/json/belongs_to_test.rb +2 -0
  96. data/test/adapter/json/collection_test.rb +2 -0
  97. data/test/adapter/json/has_many_test.rb +2 -0
  98. data/test/adapter/json/transform_test.rb +2 -0
  99. data/test/adapter/json_api/belongs_to_test.rb +2 -0
  100. data/test/adapter/json_api/collection_test.rb +2 -0
  101. data/test/adapter/json_api/errors_test.rb +2 -0
  102. data/test/adapter/json_api/fields_test.rb +2 -0
  103. data/test/adapter/json_api/has_many_explicit_serializer_test.rb +2 -0
  104. data/test/adapter/json_api/has_many_test.rb +2 -0
  105. data/test/adapter/json_api/has_one_test.rb +2 -0
  106. data/test/adapter/json_api/include_data_if_sideloaded_test.rb +2 -0
  107. data/test/adapter/json_api/json_api_test.rb +2 -0
  108. data/test/adapter/json_api/linked_test.rb +2 -0
  109. data/test/adapter/json_api/links_test.rb +2 -0
  110. data/test/adapter/json_api/pagination_links_test.rb +2 -0
  111. data/test/adapter/json_api/parse_test.rb +2 -0
  112. data/test/adapter/json_api/relationship_test.rb +2 -0
  113. data/test/adapter/json_api/resource_meta_test.rb +2 -0
  114. data/test/adapter/json_api/toplevel_jsonapi_test.rb +2 -0
  115. data/test/adapter/json_api/transform_test.rb +2 -0
  116. data/test/adapter/json_api/type_test.rb +2 -0
  117. data/test/adapter/json_test.rb +2 -0
  118. data/test/adapter/null_test.rb +2 -0
  119. data/test/adapter/polymorphic_test.rb +2 -0
  120. data/test/adapter_test.rb +2 -0
  121. data/test/array_serializer_test.rb +2 -0
  122. data/test/benchmark/app.rb +2 -0
  123. data/test/benchmark/benchmarking_support.rb +2 -0
  124. data/test/benchmark/bm_active_record.rb +2 -0
  125. data/test/benchmark/bm_adapter.rb +2 -0
  126. data/test/benchmark/bm_caching.rb +2 -0
  127. data/test/benchmark/bm_lookup_chain.rb +2 -0
  128. data/test/benchmark/bm_transform.rb +2 -0
  129. data/test/benchmark/controllers.rb +2 -0
  130. data/test/benchmark/fixtures.rb +2 -0
  131. data/test/cache_test.rb +66 -0
  132. data/test/collection_serializer_test.rb +2 -0
  133. data/test/fixtures/active_record.rb +2 -0
  134. data/test/fixtures/poro.rb +2 -0
  135. data/test/generators/scaffold_controller_generator_test.rb +2 -0
  136. data/test/generators/serializer_generator_test.rb +2 -0
  137. data/test/grape_test.rb +2 -0
  138. data/test/lint_test.rb +2 -0
  139. data/test/logger_test.rb +2 -0
  140. data/test/poro_test.rb +2 -0
  141. data/test/serializable_resource_test.rb +2 -0
  142. data/test/serializers/association_macros_test.rb +2 -0
  143. data/test/serializers/associations_test.rb +2 -0
  144. data/test/serializers/attribute_test.rb +2 -0
  145. data/test/serializers/attributes_test.rb +2 -0
  146. data/test/serializers/caching_configuration_test_isolated.rb +2 -0
  147. data/test/serializers/configuration_test.rb +2 -0
  148. data/test/serializers/fieldset_test.rb +2 -0
  149. data/test/serializers/meta_test.rb +2 -0
  150. data/test/serializers/options_test.rb +2 -0
  151. data/test/serializers/read_attribute_for_serialization_test.rb +2 -0
  152. data/test/serializers/reflection_test.rb +2 -0
  153. data/test/serializers/root_test.rb +2 -0
  154. data/test/serializers/serialization_test.rb +2 -0
  155. data/test/serializers/serializer_for_test.rb +2 -0
  156. data/test/serializers/serializer_for_with_namespace_test.rb +2 -0
  157. data/test/support/isolated_unit.rb +2 -0
  158. data/test/support/rails5_shims.rb +2 -0
  159. data/test/support/rails_app.rb +2 -0
  160. data/test/support/serialization_testing.rb +2 -0
  161. data/test/test_helper.rb +2 -0
  162. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7232014fa13e7bf11951db024282a8518806ccdd81aead05ce694398e8f16439
4
- data.tar.gz: 8337471a240ac4e1931fd71fbfbbf096e8bb5989ce51bce920d2f266aa0ac775
3
+ metadata.gz: e365d9b8e66fd40b66555a2e57faad48fee5bfd82b988ab42aacda73930bb53c
4
+ data.tar.gz: bbad118b340ea31c7a09f1f0661d0e53866135a99923276182dc159d4eeb2f9c
5
5
  SHA512:
6
- metadata.gz: 33a114c6a2f87df622d820e8d04b9ce3099891a83f30527d93c159f0014a4fc3a60f883884b6d3a16fa4daf9f65cce1a57410eee4111391351c4199a73e8ca1c
7
- data.tar.gz: 5ac71dcb57c2fd16b328cc849b948c6ae0d8cc6d409a1f0b3c942033c439e37c8c8fd8df3be5d80a8a153cb86e38d5cfe93a40fc553f09db739514759ca935a2
6
+ metadata.gz: 011fcf63a00a7cfc27a54679551cf6c03b3dd4ff177192fca7d2be34bfbb2c3b6c6ba40bc92395997a392ed9bf1d91823da15afa7bde374d08f5e9d69982d054
7
+ data.tar.gz: 8311b1ed270c60ae5d00beaa2e421a350201bec131a44096190f40dfb61a84f11d50ace18c357cc77e364863bef94eebaad717dc78a156c923049679c5295d1d
@@ -59,6 +59,10 @@ Style/MissingElse:
59
59
  Style/EmptyElse:
60
60
  EnforcedStyle: empty
61
61
 
62
+ Style/FrozenStringLiteralComment:
63
+ Enabled: true
64
+ EnforcedStyle: always
65
+
62
66
  Style/MultilineOperationIndentation:
63
67
  EnforcedStyle: indented
64
68
 
@@ -6,9 +6,9 @@ cache:
6
6
  - vendor/bundle
7
7
 
8
8
  before_install:
9
- - "travis_retry gem update --system"
10
- - "travis_retry gem update bundler"
11
- install: bundle install --path=vendor/bundle --retry=3 --jobs=3
9
+ - "travis_retry gem update --system 2.7.8"
10
+ - "travis_retry gem install bundler -v '1.17.3'"
11
+ install: BUNDLER_VERSION=1.17.3 bundle install --path=vendor/bundle --retry=3 --jobs=3
12
12
 
13
13
  script:
14
14
  - bundle exec rake ci
@@ -21,6 +21,7 @@ env:
21
21
  - "RAILS_VERSION=4.2"
22
22
  - "RAILS_VERSION=5.0"
23
23
  - "RAILS_VERSION=5.1"
24
+ - "RAILS_VERSION=5.2"
24
25
  - "RAILS_VERSION=master"
25
26
 
26
27
  rvm:
@@ -28,8 +29,13 @@ rvm:
28
29
  - 2.2.8
29
30
  - 2.3.5
30
31
  - 2.4.2
32
+ - 2.5.3
31
33
  - ruby-head
32
34
 
35
+ branches:
36
+ only:
37
+ - 0-10-stable
38
+
33
39
  matrix:
34
40
  include:
35
41
  - { rvm: jruby-9.1.13.0, jdk: oraclejdk8, env: "RAILS_VERSION=4.1 JRUBY_OPTS='--dev -J-Xmx1024M --debug'" }
@@ -42,9 +48,12 @@ matrix:
42
48
  - { rvm: 2.1.10, env: RAILS_VERSION=master }
43
49
  - { rvm: 2.2.8, env: RAILS_VERSION=master }
44
50
  - { rvm: 2.3.5, env: RAILS_VERSION=master }
51
+ - { rvm: 2.4.2, env: RAILS_VERSION=master }
45
52
  - { rvm: 2.1.10, env: RAILS_VERSION=5.0 }
46
53
  - { rvm: 2.1.10, env: RAILS_VERSION=5.1 }
54
+ - { rvm: 2.1.10, env: RAILS_VERSION=5.2 }
47
55
  - { rvm: 2.4.2, env: RAILS_VERSION=4.1 }
56
+ - { rvm: 2.5.3, env: RAILS_VERSION=4.1 }
48
57
  - { rvm: ruby-head, env: RAILS_VERSION=4.1 }
49
58
  allow_failures:
50
59
  - rvm: ruby-head
@@ -1,6 +1,6 @@
1
1
  ## 0.10.x
2
2
 
3
- ### [master (unreleased)](https://github.com/rails-api/active_model_serializers/compare/v0.10.8...0-10-stable)
3
+ ### [master (unreleased)](https://github.com/rails-api/active_model_serializers/compare/v0.10.9...0-10-stable)
4
4
 
5
5
  Breaking changes:
6
6
 
@@ -8,9 +8,22 @@ Features:
8
8
 
9
9
  Fixes:
10
10
 
11
+ Misc:
12
+
13
+ ### [v0.10.9 (2019-02-08)](https://github.com/rails-api/active_model_serializers/compare/v0.10.8...v0.10.9)
14
+
15
+
16
+ Fixes:
17
+
18
+ - [#2288](https://github.com/rails-api/active_model_serializers/pull/2288)
19
+ Change the fetch method to deal with recyclable key cache strategy.
20
+ Fixes #2287. (@cintamani, @wasifhossain)
21
+ - [#2307](https://github.com/rails-api/active_model_serializers/pull/2307) Falsey attribute values should not be reevaluated.
11
22
 
12
23
  Misc:
13
24
 
25
+ - [#2309](https://github.com/rails-api/active_model_serializers/pull/2309) Performance and memory usage fixes
26
+
14
27
  ### [v0.10.8 (2018-11-01)](https://github.com/rails-api/active_model_serializers/compare/v0.10.7...v0.10.8)
15
28
 
16
29
  Features:
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
  #
3
5
  # Add a Gemfile.local to locally bundle gems outside of version control
@@ -51,7 +53,7 @@ group :bench do
51
53
  end
52
54
 
53
55
  group :test do
54
- gem 'sqlite3', platform: (@windows_platforms + [:ruby])
56
+ gem 'sqlite3', '~> 1.3.13', platform: (@windows_platforms + [:ruby])
55
57
  platforms :jruby do
56
58
  if version == 'master' || version >= '5'
57
59
  gem 'activerecord-jdbcsqlite3-adapter', '~> 50'
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  begin
2
4
  require 'bundler/setup'
3
5
  rescue LoadError
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # coding: utf-8
2
3
  lib = File.expand_path('../lib', __FILE__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_support/core_ext/class/attribute'
2
4
  require 'active_model_serializers/serialization_context'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'set'
2
4
 
3
5
  module ActiveModel
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'thread_safe'
2
4
  require 'jsonapi/include_directive'
3
5
  require 'active_model/serializer/collection_serializer'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_model_serializers/adapter'
2
4
  require 'active_model_serializers/deprecate'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModel
2
4
  class Serializer
3
5
  module Adapter
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModel
2
4
  class Serializer
3
5
  module Adapter
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModel
2
4
  class Serializer
3
5
  module Adapter
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModel
2
4
  class Serializer
3
5
  module Adapter
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModel
2
4
  class Serializer
3
5
  module Adapter
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_model/serializer/collection_serializer'
2
4
 
3
5
  module ActiveModel
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_model/serializer/lazy_association'
2
4
 
3
5
  module ActiveModel
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_model/serializer/field'
2
4
 
3
5
  module ActiveModel
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModel
2
4
  class Serializer
3
5
  # @api private
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModel
2
4
  class Serializer
3
5
  class CollectionSerializer
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModel
2
4
  class Serializer
3
5
  UndefinedCacheKey = Class.new(StandardError)
@@ -281,7 +283,9 @@ module ActiveModel
281
283
  # Use object's cache_key if available, else derive a key from the object
282
284
  # Pass the `key` option to the `cache` declaration or override this method to customize the cache key
283
285
  def object_cache_key
284
- if object.respond_to?(:cache_key)
286
+ if object.respond_to?(:cache_key_with_version)
287
+ object.cache_key_with_version
288
+ elsif object.respond_to?(:cache_key)
285
289
  object.cache_key
286
290
  elsif (serializer_cache_key = (serializer_class._cache_key || serializer_class._cache_options[:key]))
287
291
  object_time_safe = object.updated_at
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModel
2
4
  class Serializer
3
5
  class ErrorSerializer < ActiveModel::Serializer
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_model/serializer/error_serializer'
2
4
 
3
5
  module ActiveModel
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModel
2
4
  class Serializer
3
5
  # Holds all the meta-data about a field (i.e. attribute or association) as it was
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModel
2
4
  class Serializer
3
5
  class Fieldset
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModel
2
4
  class Serializer
3
5
  # @api private
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModel
2
4
  class Serializer
3
5
  # @api private
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModel
2
4
  class Serializer
3
5
  # @api private
@@ -7,11 +9,12 @@ module ActiveModel
7
9
  delegate :collection?, to: :reflection
8
10
 
9
11
  def reflection_options
10
- @reflection_options ||= reflection.options.dup.reject { |k, _| !REFLECTION_OPTIONS.include?(k) }
12
+ @reflection_options ||= reflection.options.select { |k, _| REFLECTION_OPTIONS.include?(k) }
11
13
  end
12
14
 
13
15
  def object
14
- @object ||= reflection.value(
16
+ return @object if defined?(@object)
17
+ @object = reflection.value(
15
18
  association_options.fetch(:parent_serializer),
16
19
  association_options.fetch(:include_slice)
17
20
  )
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_model/serializer/field'
2
4
 
3
5
  module ActiveModel
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModel
2
4
  class Serializer
3
5
  module Lint
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModel
2
4
  class Serializer
3
5
  class Null < Serializer
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_model/serializer/field'
2
4
  require 'active_model/serializer/association'
3
5
 
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModel
2
4
  class Serializer
3
- VERSION = '0.10.8'.freeze
5
+ VERSION = '0.10.9'.freeze
4
6
  end
5
7
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_model'
2
4
  require 'active_support'
3
5
  require 'active_support/core_ext/object/with_options'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModelSerializers
2
4
  module Adapter
3
5
  UnknownAdapterError = Class.new(ArgumentError)
@@ -35,7 +37,7 @@ module ActiveModelSerializers
35
37
 
36
38
  # @return [Array<Symbol>] list of adapter names
37
39
  def adapters
38
- adapter_map.keys.sort
40
+ adapter_map.keys.sort!
39
41
  end
40
42
 
41
43
  # Adds an adapter 'klass' with 'name' to the 'adapter_map'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModelSerializers
2
4
  module Adapter
3
5
  class Attributes < Base
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'case_transform'
2
4
 
3
5
  module ActiveModelSerializers
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModelSerializers
2
4
  module Adapter
3
5
  class Json < Base
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # {http://jsonapi.org/format/ JSON API specification}
2
4
  # rubocop:disable Style/AsciiComments
3
5
  # TODO: implement!
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModelSerializers
2
4
  module Adapter
3
5
  class JsonApi
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModelSerializers
2
4
  module Adapter
3
5
  class JsonApi < Base
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModelSerializers
2
4
  module Adapter
3
5
  class JsonApi < Base
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModelSerializers
2
4
  module Adapter
3
5
  class JsonApi
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModelSerializers
2
4
  module Adapter
3
5
  class JsonApi
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModelSerializers
2
4
  module Adapter
3
5
  class JsonApi < Base
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModelSerializers
2
4
  module Adapter
3
5
  class JsonApi
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModelSerializers
2
4
  module Adapter
3
5
  class JsonApi