active_model_serializers_custom 0.10.90

Sign up to get free protection for your applications and to get access to all the features.
Files changed (215) hide show
  1. checksums.yaml +7 -0
  2. data/.github/ISSUE_TEMPLATE.md +29 -0
  3. data/.github/PULL_REQUEST_TEMPLATE.md +15 -0
  4. data/.gitignore +35 -0
  5. data/.rubocop.yml +109 -0
  6. data/.simplecov +110 -0
  7. data/.travis.yml +63 -0
  8. data/CHANGELOG.md +727 -0
  9. data/CODE_OF_CONDUCT.md +74 -0
  10. data/CONTRIBUTING.md +105 -0
  11. data/Gemfile +74 -0
  12. data/MIT-LICENSE +22 -0
  13. data/README.md +305 -0
  14. data/Rakefile +76 -0
  15. data/active_model_serializers.gemspec +64 -0
  16. data/appveyor.yml +28 -0
  17. data/bin/bench +171 -0
  18. data/bin/bench_regression +316 -0
  19. data/bin/rubocop +38 -0
  20. data/bin/serve_benchmark +39 -0
  21. data/docs/README.md +41 -0
  22. data/docs/STYLE.md +58 -0
  23. data/docs/general/adapters.md +269 -0
  24. data/docs/general/caching.md +58 -0
  25. data/docs/general/configuration_options.md +185 -0
  26. data/docs/general/deserialization.md +100 -0
  27. data/docs/general/fields.md +31 -0
  28. data/docs/general/getting_started.md +133 -0
  29. data/docs/general/instrumentation.md +40 -0
  30. data/docs/general/key_transforms.md +40 -0
  31. data/docs/general/logging.md +21 -0
  32. data/docs/general/rendering.md +293 -0
  33. data/docs/general/serializers.md +495 -0
  34. data/docs/how-open-source-maintained.jpg +0 -0
  35. data/docs/howto/add_pagination_links.md +138 -0
  36. data/docs/howto/add_relationship_links.md +140 -0
  37. data/docs/howto/add_root_key.md +62 -0
  38. data/docs/howto/grape_integration.md +42 -0
  39. data/docs/howto/outside_controller_use.md +66 -0
  40. data/docs/howto/passing_arbitrary_options.md +27 -0
  41. data/docs/howto/serialize_poro.md +73 -0
  42. data/docs/howto/test.md +154 -0
  43. data/docs/howto/upgrade_from_0_8_to_0_10.md +265 -0
  44. data/docs/integrations/ember-and-json-api.md +147 -0
  45. data/docs/integrations/grape.md +19 -0
  46. data/docs/jsonapi/errors.md +56 -0
  47. data/docs/jsonapi/schema.md +151 -0
  48. data/docs/jsonapi/schema/schema.json +366 -0
  49. data/docs/rfcs/0000-namespace.md +106 -0
  50. data/docs/rfcs/template.md +15 -0
  51. data/lib/action_controller/serialization.rb +76 -0
  52. data/lib/active_model/serializable_resource.rb +13 -0
  53. data/lib/active_model/serializer.rb +418 -0
  54. data/lib/active_model/serializer/adapter.rb +26 -0
  55. data/lib/active_model/serializer/adapter/attributes.rb +17 -0
  56. data/lib/active_model/serializer/adapter/base.rb +20 -0
  57. data/lib/active_model/serializer/adapter/json.rb +17 -0
  58. data/lib/active_model/serializer/adapter/json_api.rb +17 -0
  59. data/lib/active_model/serializer/adapter/null.rb +17 -0
  60. data/lib/active_model/serializer/array_serializer.rb +14 -0
  61. data/lib/active_model/serializer/association.rb +91 -0
  62. data/lib/active_model/serializer/attribute.rb +27 -0
  63. data/lib/active_model/serializer/belongs_to_reflection.rb +13 -0
  64. data/lib/active_model/serializer/collection_serializer.rb +90 -0
  65. data/lib/active_model/serializer/concerns/caching.rb +304 -0
  66. data/lib/active_model/serializer/error_serializer.rb +16 -0
  67. data/lib/active_model/serializer/errors_serializer.rb +34 -0
  68. data/lib/active_model/serializer/field.rb +92 -0
  69. data/lib/active_model/serializer/fieldset.rb +33 -0
  70. data/lib/active_model/serializer/has_many_reflection.rb +12 -0
  71. data/lib/active_model/serializer/has_one_reflection.rb +9 -0
  72. data/lib/active_model/serializer/lazy_association.rb +99 -0
  73. data/lib/active_model/serializer/link.rb +23 -0
  74. data/lib/active_model/serializer/lint.rb +152 -0
  75. data/lib/active_model/serializer/null.rb +19 -0
  76. data/lib/active_model/serializer/reflection.rb +212 -0
  77. data/lib/active_model/serializer/version.rb +7 -0
  78. data/lib/active_model_serializers.rb +63 -0
  79. data/lib/active_model_serializers/adapter.rb +100 -0
  80. data/lib/active_model_serializers/adapter/attributes.rb +15 -0
  81. data/lib/active_model_serializers/adapter/base.rb +85 -0
  82. data/lib/active_model_serializers/adapter/json.rb +23 -0
  83. data/lib/active_model_serializers/adapter/json_api.rb +535 -0
  84. data/lib/active_model_serializers/adapter/json_api/deserialization.rb +215 -0
  85. data/lib/active_model_serializers/adapter/json_api/error.rb +98 -0
  86. data/lib/active_model_serializers/adapter/json_api/jsonapi.rb +51 -0
  87. data/lib/active_model_serializers/adapter/json_api/link.rb +85 -0
  88. data/lib/active_model_serializers/adapter/json_api/meta.rb +39 -0
  89. data/lib/active_model_serializers/adapter/json_api/pagination_links.rb +90 -0
  90. data/lib/active_model_serializers/adapter/json_api/relationship.rb +106 -0
  91. data/lib/active_model_serializers/adapter/json_api/resource_identifier.rb +68 -0
  92. data/lib/active_model_serializers/adapter/null.rb +11 -0
  93. data/lib/active_model_serializers/callbacks.rb +57 -0
  94. data/lib/active_model_serializers/deprecate.rb +56 -0
  95. data/lib/active_model_serializers/deserialization.rb +17 -0
  96. data/lib/active_model_serializers/json_pointer.rb +16 -0
  97. data/lib/active_model_serializers/logging.rb +124 -0
  98. data/lib/active_model_serializers/lookup_chain.rb +82 -0
  99. data/lib/active_model_serializers/model.rb +132 -0
  100. data/lib/active_model_serializers/railtie.rb +52 -0
  101. data/lib/active_model_serializers/register_jsonapi_renderer.rb +80 -0
  102. data/lib/active_model_serializers/serializable_resource.rb +84 -0
  103. data/lib/active_model_serializers/serialization_context.rb +41 -0
  104. data/lib/active_model_serializers/test.rb +9 -0
  105. data/lib/active_model_serializers/test/schema.rb +140 -0
  106. data/lib/active_model_serializers/test/serializer.rb +127 -0
  107. data/lib/generators/rails/USAGE +6 -0
  108. data/lib/generators/rails/resource_override.rb +12 -0
  109. data/lib/generators/rails/serializer_generator.rb +38 -0
  110. data/lib/generators/rails/templates/serializer.rb.erb +8 -0
  111. data/lib/grape/active_model_serializers.rb +18 -0
  112. data/lib/grape/formatters/active_model_serializers.rb +34 -0
  113. data/lib/grape/helpers/active_model_serializers.rb +19 -0
  114. data/lib/tasks/rubocop.rake +55 -0
  115. data/test/action_controller/adapter_selector_test.rb +64 -0
  116. data/test/action_controller/explicit_serializer_test.rb +137 -0
  117. data/test/action_controller/json/include_test.rb +248 -0
  118. data/test/action_controller/json_api/deserialization_test.rb +114 -0
  119. data/test/action_controller/json_api/errors_test.rb +42 -0
  120. data/test/action_controller/json_api/fields_test.rb +68 -0
  121. data/test/action_controller/json_api/linked_test.rb +204 -0
  122. data/test/action_controller/json_api/pagination_test.rb +126 -0
  123. data/test/action_controller/json_api/transform_test.rb +191 -0
  124. data/test/action_controller/lookup_proc_test.rb +51 -0
  125. data/test/action_controller/namespace_lookup_test.rb +239 -0
  126. data/test/action_controller/serialization_scope_name_test.rb +237 -0
  127. data/test/action_controller/serialization_test.rb +480 -0
  128. data/test/active_model_serializers/adapter_for_test.rb +210 -0
  129. data/test/active_model_serializers/json_pointer_test.rb +24 -0
  130. data/test/active_model_serializers/logging_test.rb +79 -0
  131. data/test/active_model_serializers/model_test.rb +144 -0
  132. data/test/active_model_serializers/railtie_test_isolated.rb +70 -0
  133. data/test/active_model_serializers/register_jsonapi_renderer_test_isolated.rb +163 -0
  134. data/test/active_model_serializers/serialization_context_test_isolated.rb +73 -0
  135. data/test/active_model_serializers/test/schema_test.rb +133 -0
  136. data/test/active_model_serializers/test/serializer_test.rb +64 -0
  137. data/test/active_record_test.rb +11 -0
  138. data/test/adapter/attributes_test.rb +42 -0
  139. data/test/adapter/deprecation_test.rb +102 -0
  140. data/test/adapter/json/belongs_to_test.rb +47 -0
  141. data/test/adapter/json/collection_test.rb +106 -0
  142. data/test/adapter/json/has_many_test.rb +55 -0
  143. data/test/adapter/json/transform_test.rb +95 -0
  144. data/test/adapter/json_api/belongs_to_test.rb +157 -0
  145. data/test/adapter/json_api/collection_test.rb +98 -0
  146. data/test/adapter/json_api/errors_test.rb +78 -0
  147. data/test/adapter/json_api/fields_test.rb +98 -0
  148. data/test/adapter/json_api/has_many_explicit_serializer_test.rb +98 -0
  149. data/test/adapter/json_api/has_many_test.rb +175 -0
  150. data/test/adapter/json_api/has_one_test.rb +82 -0
  151. data/test/adapter/json_api/include_data_if_sideloaded_test.rb +215 -0
  152. data/test/adapter/json_api/json_api_test.rb +35 -0
  153. data/test/adapter/json_api/linked_test.rb +415 -0
  154. data/test/adapter/json_api/links_test.rb +112 -0
  155. data/test/adapter/json_api/pagination_links_test.rb +208 -0
  156. data/test/adapter/json_api/parse_test.rb +139 -0
  157. data/test/adapter/json_api/relationship_test.rb +399 -0
  158. data/test/adapter/json_api/resource_meta_test.rb +102 -0
  159. data/test/adapter/json_api/toplevel_jsonapi_test.rb +84 -0
  160. data/test/adapter/json_api/transform_test.rb +514 -0
  161. data/test/adapter/json_api/type_test.rb +195 -0
  162. data/test/adapter/json_test.rb +48 -0
  163. data/test/adapter/null_test.rb +24 -0
  164. data/test/adapter/polymorphic_test.rb +220 -0
  165. data/test/adapter_test.rb +69 -0
  166. data/test/array_serializer_test.rb +24 -0
  167. data/test/benchmark/app.rb +67 -0
  168. data/test/benchmark/benchmarking_support.rb +69 -0
  169. data/test/benchmark/bm_active_record.rb +83 -0
  170. data/test/benchmark/bm_adapter.rb +40 -0
  171. data/test/benchmark/bm_caching.rb +121 -0
  172. data/test/benchmark/bm_lookup_chain.rb +85 -0
  173. data/test/benchmark/bm_transform.rb +47 -0
  174. data/test/benchmark/config.ru +3 -0
  175. data/test/benchmark/controllers.rb +85 -0
  176. data/test/benchmark/fixtures.rb +221 -0
  177. data/test/cache_test.rb +717 -0
  178. data/test/collection_serializer_test.rb +129 -0
  179. data/test/fixtures/active_record.rb +115 -0
  180. data/test/fixtures/poro.rb +227 -0
  181. data/test/generators/scaffold_controller_generator_test.rb +26 -0
  182. data/test/generators/serializer_generator_test.rb +77 -0
  183. data/test/grape_test.rb +198 -0
  184. data/test/lint_test.rb +51 -0
  185. data/test/logger_test.rb +22 -0
  186. data/test/poro_test.rb +11 -0
  187. data/test/serializable_resource_test.rb +81 -0
  188. data/test/serializers/association_macros_test.rb +39 -0
  189. data/test/serializers/associations_test.rb +520 -0
  190. data/test/serializers/attribute_test.rb +155 -0
  191. data/test/serializers/attributes_test.rb +54 -0
  192. data/test/serializers/caching_configuration_test_isolated.rb +172 -0
  193. data/test/serializers/configuration_test.rb +34 -0
  194. data/test/serializers/fieldset_test.rb +16 -0
  195. data/test/serializers/meta_test.rb +204 -0
  196. data/test/serializers/options_test.rb +34 -0
  197. data/test/serializers/read_attribute_for_serialization_test.rb +81 -0
  198. data/test/serializers/reflection_test.rb +481 -0
  199. data/test/serializers/root_test.rb +23 -0
  200. data/test/serializers/serialization_test.rb +57 -0
  201. data/test/serializers/serializer_for_test.rb +138 -0
  202. data/test/serializers/serializer_for_with_namespace_test.rb +90 -0
  203. data/test/support/custom_schemas/active_model_serializers/test/schema_test/my/index.json +6 -0
  204. data/test/support/isolated_unit.rb +86 -0
  205. data/test/support/rails5_shims.rb +55 -0
  206. data/test/support/rails_app.rb +40 -0
  207. data/test/support/schemas/active_model_serializers/test/schema_test/my/index.json +6 -0
  208. data/test/support/schemas/active_model_serializers/test/schema_test/my/show.json +6 -0
  209. data/test/support/schemas/custom/show.json +7 -0
  210. data/test/support/schemas/hyper_schema.json +93 -0
  211. data/test/support/schemas/render_using_json_api.json +43 -0
  212. data/test/support/schemas/simple_json_pointers.json +10 -0
  213. data/test/support/serialization_testing.rb +81 -0
  214. data/test/test_helper.rb +72 -0
  215. metadata +622 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ca6258e0fcb1cd65198824d35957abceaf39533d
4
+ data.tar.gz: eb93e67630db55e4f4e9907e30a98a5cc27778af
5
+ SHA512:
6
+ metadata.gz: 70f5c4455cf49bd87efcfd681a7331b49eda81dc5136ca8a666dd17583d710cc3cf2db1e9a5f9a1ab8b1345bfcd6322adae2d8a2eeb09b4880283449b05607b2
7
+ data.tar.gz: 7e937ace364d7a15033a43ca565e52637719a9233197ec80dc5af40e11128bedbf3b61326f38fb8d50cbf9edb03b890220a119e129f907fd44e70aa7ed2d8e3b
@@ -0,0 +1,29 @@
1
+ #### Expected behavior vs actual behavior
2
+
3
+
4
+
5
+ #### Steps to reproduce
6
+ *(e.g., detailed walkthrough, runnable script, example application)*
7
+
8
+
9
+
10
+ #### Environment
11
+
12
+ ActiveModelSerializers Version *(commit ref if not on tag)*:
13
+
14
+ Output of `ruby -e "puts RUBY_DESCRIPTION"`:
15
+
16
+ OS Type & Version:
17
+
18
+ Integrated application and version *(e.g., Rails, Grape, etc)*:
19
+
20
+
21
+ #### Backtrace
22
+ *(e.g., provide any applicable backtraces from your application)*
23
+
24
+
25
+
26
+ #### Additonal helpful information
27
+ *(e.g., Gemfile.lock, configurations, PR containing a failing test, git bisect results)*
28
+
29
+
@@ -0,0 +1,15 @@
1
+ #### Purpose
2
+
3
+
4
+ #### Changes
5
+
6
+
7
+ #### Caveats
8
+
9
+
10
+ #### Related GitHub issues
11
+
12
+
13
+ #### Additional helpful information
14
+
15
+
@@ -0,0 +1,35 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ Gemfile.local
8
+ InstalledFiles
9
+ _yardoc
10
+ coverage
11
+ doc/
12
+ lib/bundler/man
13
+ pkg
14
+ Vagrantfile
15
+ .vagrant
16
+ rdoc
17
+ spec/reports
18
+ test/tmp
19
+ test/version_tmp
20
+ tmp
21
+ *.swp
22
+ .ruby-version
23
+ .ruby-gemset
24
+ vendor/bundle
25
+ tags
26
+
27
+ # silly macs
28
+ .DS_Store
29
+ .DS_Store?
30
+ ._*
31
+ .Spotlight-V100
32
+ .Trashes
33
+ Icon?
34
+ ehthumbs.db
35
+ Thumbs.db
@@ -0,0 +1,109 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.1
3
+ Exclude:
4
+ - !ruby/regexp /(vendor|bundle|bin|db|tmp)\/.*/
5
+ DisplayCopNames: true
6
+ DisplayStyleGuide: true
7
+ # https://github.com/bbatsov/rubocop/blob/master/manual/caching.md
8
+ # https://github.com/bbatsov/rubocop/blob/e8680418b351491e111a18cf5b453fc07a3c5239/config/default.yml#L60-L77
9
+ UseCache: true
10
+ CacheRootDirectory: tmp
11
+
12
+ Rails:
13
+ Enabled: true
14
+
15
+ Lint/NestedMethodDefinition:
16
+ Enabled: false
17
+ Exclude:
18
+ - test/action_controller/serialization_test.rb
19
+
20
+ Style/Alias:
21
+ EnforcedStyle: prefer_alias
22
+
23
+ Style/StringLiterals:
24
+ EnforcedStyle: single_quotes
25
+
26
+ Metrics/AbcSize:
27
+ Max: 35 # TODO: Lower to 15
28
+
29
+ Metrics/ClassLength:
30
+ Max: 261 # TODO: Lower to 100
31
+ Exclude:
32
+ - test/**/*.rb
33
+
34
+ Metrics/CyclomaticComplexity:
35
+ Max: 7 # TODO: Lower to 6
36
+
37
+ Metrics/LineLength:
38
+ Max: 251 # TODO: Lower to 80
39
+
40
+ Metrics/MethodLength:
41
+ Max: 106 # TODO: Lower to 10
42
+
43
+ Metrics/PerceivedComplexity:
44
+ Max: 9 # TODO: Lower to 7
45
+
46
+ Style/AlignParameters:
47
+ EnforcedStyle: with_fixed_indentation
48
+
49
+ Style/ClassAndModuleChildren:
50
+ EnforcedStyle: nested
51
+
52
+ Style/Documentation:
53
+ Enabled: false
54
+
55
+ Style/MissingElse:
56
+ Enabled: true
57
+ EnforcedStyle: case
58
+
59
+ Style/EmptyElse:
60
+ EnforcedStyle: empty
61
+
62
+ Style/FrozenStringLiteralComment:
63
+ Enabled: true
64
+ EnforcedStyle: always
65
+
66
+ Style/MultilineOperationIndentation:
67
+ EnforcedStyle: indented
68
+
69
+ Style/BlockDelimiters:
70
+ Enabled: true
71
+ EnforcedStyle: line_count_based
72
+
73
+ Style/SignalException:
74
+ EnforcedStyle: semantic
75
+
76
+ Style/TrailingCommaInLiteral:
77
+ EnforcedStyleForMultiline: no_comma
78
+
79
+ Style/ConditionalAssignment:
80
+ Enabled: false
81
+
82
+ Style/DotPosition:
83
+ EnforcedStyle: leading
84
+
85
+ ########## test_helper.rb sanity
86
+ Style/EndBlock:
87
+ Exclude:
88
+ - test/test_helper.rb
89
+
90
+ Style/SpecialGlobalVars:
91
+ Exclude:
92
+ - test/test_helper.rb
93
+
94
+ Style/GlobalVars:
95
+ Exclude:
96
+ - test/test_helper.rb
97
+
98
+ Style/AndOr:
99
+ Exclude:
100
+ - test/test_helper.rb
101
+ - 'lib/active_model/serializer/lint.rb'
102
+
103
+ Style/Not:
104
+ Exclude:
105
+ - test/test_helper.rb
106
+
107
+ Style/ClassCheck:
108
+ Exclude:
109
+ - test/test_helper.rb
@@ -0,0 +1,110 @@
1
+ # https://github.com/colszowka/simplecov#using-simplecov-for-centralized-config
2
+ # see https://github.com/colszowka/simplecov/blob/master/lib/simplecov/defaults.rb
3
+ # vim: set ft=ruby
4
+
5
+ ## DEFINE VARIABLES
6
+ @minimum_coverage = ENV.fetch('COVERAGE_MINIMUM') {
7
+ case (defined?(RUBY_ENGINE) && RUBY_ENGINE) || "ruby"
8
+ when 'jruby', 'rbx'
9
+ 96.0
10
+ else
11
+ 98.1
12
+ end
13
+ }.to_f.round(2)
14
+ # rubocop:disable Style/DoubleNegation
15
+ ENV['FULL_BUILD'] ||= ENV['CI']
16
+ @running_ci = !!(ENV['FULL_BUILD'] =~ /\Atrue\z/i)
17
+ @generate_report = @running_ci || !!(ENV['COVERAGE'] =~ /\Atrue\z/i)
18
+ @output = STDOUT
19
+ # rubocop:enable Style/DoubleNegation
20
+
21
+ ## CONFIGURE SIMPLECOV
22
+
23
+ SimpleCov.profiles.define 'app' do
24
+ coverage_dir 'coverage'
25
+ load_profile 'test_frameworks'
26
+
27
+ add_group 'Libraries', 'lib'
28
+
29
+ add_group 'Long files' do |src_file|
30
+ src_file.lines.count > 100
31
+ end
32
+ class MaxLinesFilter < SimpleCov::Filter
33
+ def matches?(source_file)
34
+ source_file.lines.count < filter_argument
35
+ end
36
+ end
37
+ add_group 'Short files', MaxLinesFilter.new(5)
38
+
39
+ # Exclude these paths from analysis
40
+ add_filter '/config/'
41
+ add_filter '/db/'
42
+ add_filter 'tasks'
43
+ add_filter '/.bundle/'
44
+ end
45
+
46
+ ## START TRACKING COVERAGE (before activating SimpleCov)
47
+ require 'coverage'
48
+ Coverage.start
49
+
50
+ ## ADD SOME CUSTOM REPORTING AT EXIT
51
+ SimpleCov.at_exit do
52
+ next if $! and not ($!.kind_of? SystemExit and $!.success?)
53
+
54
+ header = "#{'*' * 20} SimpleCov Results #{'*' * 20}"
55
+ results = SimpleCov.result.format!.join("\n")
56
+ exit_message = <<-EOF
57
+
58
+ #{header}
59
+ {{RESULTS}}
60
+ {{FAILURE_MESSAGE}}
61
+
62
+ #{'*' * header.size}
63
+ EOF
64
+ percent = Float(SimpleCov.result.covered_percent)
65
+ if percent < @minimum_coverage
66
+ failure_message = <<-EOF
67
+ Spec coverage was not high enough: #{percent.round(2)}% is < #{@minimum_coverage}%
68
+ EOF
69
+ exit_message.sub!('{{RESULTS}}', results).sub!('{{FAILURE_MESSAGE}}', failure_message)
70
+ @output.puts exit_message
71
+ abort(failure_message) if @generate_report
72
+ elsif @running_ci
73
+ exit_message.sub!('{{RESULTS}}', results).sub!('{{FAILURE_MESSAGE}}', <<-EOF)
74
+ Nice job! Spec coverage (#{percent.round(2)}%) is still at or above #{@minimum_coverage}%
75
+ EOF
76
+ @output.puts exit_message
77
+ end
78
+ end
79
+
80
+ ## CAPTURE CONFIG IN CLOSURE 'AppCoverage.start'
81
+ ## to defer running until test/test_helper.rb is loaded.
82
+ # rubocop:disable Style/MultilineBlockChain
83
+ AppCoverage = Class.new do
84
+ def initialize(&block)
85
+ @block = block
86
+ end
87
+
88
+ def start
89
+ @block.call
90
+ end
91
+ end.new do
92
+ SimpleCov.start 'app'
93
+ if @generate_report
94
+ if @running_ci
95
+ require 'codeclimate-test-reporter'
96
+ @output.puts '[COVERAGE] Running with SimpleCov Simple Formatter and CodeClimate Test Reporter'
97
+ formatters = [
98
+ SimpleCov::Formatter::SimpleFormatter,
99
+ CodeClimate::TestReporter::Formatter
100
+ ]
101
+ else
102
+ @output.puts '[COVERAGE] Running with SimpleCov HTML Formatter'
103
+ formatters = [SimpleCov::Formatter::HTMLFormatter]
104
+ end
105
+ else
106
+ formatters = []
107
+ end
108
+ SimpleCov.formatters = formatters
109
+ end
110
+ # rubocop:enable Style/MultilineBlockChain
@@ -0,0 +1,63 @@
1
+ language: ruby
2
+ sudo: false
3
+
4
+ cache:
5
+ directories:
6
+ - vendor/bundle
7
+
8
+ before_install:
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
+
13
+ script:
14
+ - bundle exec rake ci
15
+ after_success:
16
+ - codeclimate-test-reporter
17
+
18
+ env:
19
+ matrix:
20
+ - "RAILS_VERSION=4.1"
21
+ - "RAILS_VERSION=4.2"
22
+ - "RAILS_VERSION=5.0"
23
+ - "RAILS_VERSION=5.1"
24
+ - "RAILS_VERSION=5.2"
25
+ - "RAILS_VERSION=master"
26
+
27
+ rvm:
28
+ - 2.1.10
29
+ - 2.2.8
30
+ - 2.3.5
31
+ - 2.4.2
32
+ - 2.5.3
33
+ - ruby-head
34
+
35
+ branches:
36
+ only:
37
+ - 0-10-stable
38
+
39
+ matrix:
40
+ include:
41
+ - { rvm: jruby-9.1.13.0, jdk: oraclejdk8, env: "RAILS_VERSION=4.1 JRUBY_OPTS='--dev -J-Xmx1024M --debug'" }
42
+ - { rvm: jruby-9.1.13.0, jdk: oraclejdk8, env: "RAILS_VERSION=4.2 JRUBY_OPTS='--dev -J-Xmx1024M --debug'" }
43
+ - { rvm: jruby-9.1.13.0, jdk: oraclejdk8, env: "RAILS_VERSION=5.1 JRUBY_OPTS='--dev -J-Xmx1024M --debug'" }
44
+ # See JRuby currently failing on Rails 5+ https://github.com/jruby/activerecord-jdbc-adapter/issues/708
45
+ # - { rvm: jruby-9.1.13.0, jdk: oraclejdk8, env: "RAILS_VERSION=5.0 JRUBY_OPTS='--dev -J-Xmx1024M --debug'" }
46
+ # - { rvm: jruby-head, jdk: oraclejdk8, env: "RAILS_VERSION=5.1 JRUBY_OPTS='--dev -J-Xmx1024M --debug'" }
47
+ exclude:
48
+ - { rvm: 2.1.10, env: RAILS_VERSION=master }
49
+ - { rvm: 2.2.8, env: RAILS_VERSION=master }
50
+ - { rvm: 2.3.5, env: RAILS_VERSION=master }
51
+ - { rvm: 2.4.2, env: RAILS_VERSION=master }
52
+ - { rvm: 2.1.10, env: RAILS_VERSION=5.0 }
53
+ - { rvm: 2.1.10, env: RAILS_VERSION=5.1 }
54
+ - { rvm: 2.1.10, env: RAILS_VERSION=5.2 }
55
+ - { rvm: 2.4.2, env: RAILS_VERSION=4.1 }
56
+ - { rvm: 2.5.3, env: RAILS_VERSION=4.1 }
57
+ - { rvm: ruby-head, env: RAILS_VERSION=4.1 }
58
+ allow_failures:
59
+ - rvm: ruby-head
60
+ - rvm: jruby-head
61
+ # See JRuby currently failing on Rails 5+ https://github.com/jruby/activerecord-jdbc-adapter/issues/708
62
+ - { rvm: jruby-9.1.13.0, jdk: oraclejdk8, env: "RAILS_VERSION=5.1 JRUBY_OPTS='--dev -J-Xmx1024M --debug'" }
63
+ fast_finish: true
@@ -0,0 +1,727 @@
1
+ ## 0.10.x
2
+
3
+ ### [master (unreleased)](https://github.com/rails-api/active_model_serializers/compare/v0.10.9...0-10-stable)
4
+
5
+ Breaking changes:
6
+
7
+ Features:
8
+
9
+ Fixes:
10
+ - [#2319](https://github.com/rails-api/active_model_serializers/pull/2319) Fixes #2316. (@kylekeesling)
11
+ - Fix Rails 6.0 deprication warnings
12
+ - update test fixture schema to use `timestamps` instead of `timestamp`
13
+
14
+ Misc:
15
+
16
+ ### [v0.10.9 (2019-02-08)](https://github.com/rails-api/active_model_serializers/compare/v0.10.8...v0.10.9)
17
+
18
+
19
+ Fixes:
20
+
21
+ - [#2288](https://github.com/rails-api/active_model_serializers/pull/2288)
22
+ Change the fetch method to deal with recyclable key cache strategy.
23
+ Fixes #2287. (@cintamani, @wasifhossain)
24
+ - [#2307](https://github.com/rails-api/active_model_serializers/pull/2307) Falsey attribute values should not be reevaluated.
25
+
26
+ Misc:
27
+
28
+ - [#2309](https://github.com/rails-api/active_model_serializers/pull/2309) Performance and memory usage fixes
29
+
30
+ ### [v0.10.8 (2018-11-01)](https://github.com/rails-api/active_model_serializers/compare/v0.10.7...v0.10.8)
31
+
32
+ Features:
33
+ - [#2279](https://github.com/rails-api/active_model_serializers/pull/2279) Support condition options in serializer link statements
34
+
35
+ Fixes:
36
+
37
+ - [#2296](https://github.com/rails-api/active_model_serializers/pull/2296) Fixes #2295 (@Hirurg103)
38
+ - Fix finding of namespaced serializer and non-namespaced model.
39
+ - [#2289](https://github.com/rails-api/active_model_serializers/pull/2289) Fixes #2255 (@f-mer)
40
+ - Fix autoloading race condition, especially in Rails 5.
41
+ - [#2299](https://github.com/rails-api/active_model_serializers/pull/2299) Fixes #2270 (@chau-bao-long via #2276)
42
+ - Fix reflection thread-safety bug
43
+
44
+ ### [v0.10.7 (2017-11-14)](https://github.com/rails-api/active_model_serializers/compare/v0.10.6...v0.10.7)
45
+
46
+ Regressions Fixed From v0.10.6:
47
+
48
+ - [#2211](https://github.com/rails-api/active_model_serializers/pull/2211). Fixes #2125, #2160. (@bf4)
49
+ - Fix polymorphic belongs_to tests; passes on v0.10.5, fails on v0.10.6
50
+ - Fix JSON:API polymorphic type regression from v0.10.5
51
+ - Fix JSON:API: for_type_and_id should always inflect_type
52
+ ```
53
+ Should Serializer._type ever be inflected?
54
+ Right now, it won't be, but association.serializer._type will be inflected.
55
+
56
+ That's the current behavior.
57
+ ```
58
+ - [#2216](https://github.com/rails-api/active_model_serializers/pull/2216). Fixes #2132, #2180. (@bf4)
59
+ - Fix JSON:API: Serialize resource type for unpersisted records (blank id)
60
+ - [#2218](https://github.com/rails-api/active_model_serializers/pull/2218). Fixes #2178. (@bf4)
61
+ - Fix JSON:API: Make using foreign key on belongs_to opt-in. No effect on polymorphic relationships.
62
+ ```
63
+ # set to true to opt-in
64
+ ActiveModelSerializer.config.jsonapi_use_foreign_key_on_belongs_to_relationship = true
65
+ ```
66
+
67
+ Features:
68
+
69
+ - [#2136](https://github.com/rails-api/active_model_serializers/pull/2136) Enable inclusion of sideloaded relationship objects by `key`. (@caomania)
70
+ - [#2021](https://github.com/rails-api/active_model_serializers/pull/2021) ActiveModelSerializers::Model#attributes. Originally in [#1982](https://github.com/rails-api/active_model_serializers/pull/1982). (@bf4)
71
+ - [#2130](https://github.com/rails-api/active_model_serializers/pull/2130) Allow serialized ID to be overwritten for belongs-to relationships. (@greysteil)
72
+ - [#2189](https://github.com/rails-api/active_model_serializers/pull/2189)
73
+ Update version constraint for jsonapi-renderer to `['>= 0.1.1.beta1', '< 0.3']`
74
+ (@tagliala)
75
+
76
+ Fixes:
77
+
78
+ - [#2022](https://github.com/rails-api/active_model_serializers/pull/2022) Mutation of ActiveModelSerializers::Model now changes the attributes. Originally in [#1984](https://github.com/rails-api/active_model_serializers/pull/1984). (@bf4)
79
+ - [#2200](https://github.com/rails-api/active_model_serializers/pull/2200) Fix deserialization of polymorphic relationships. (@dennis95stumm)
80
+ - [#2214](https://github.com/rails-api/active_model_serializers/pull/2214) Fail if unable to infer collection type with json adapter. (@jmeredith16)
81
+ - [#2149](https://github.com/rails-api/active_model_serializers/pull/2149) Always include self, first, last pagination link. (@mecampbellsoup)
82
+ - [#2179](https://github.com/rails-api/active_model_serializers/pull/2179) Fixes #2173, Pass block to Enumerator.new. (@drn)
83
+
84
+ Misc:
85
+
86
+ - [#2176](https://github.com/rails-api/active_model_serializers/pull/2176) Documentation for global adapter config. (@mrpinsky)
87
+ - [#2215](https://github.com/rails-api/active_model_serializers/pull/2215) Update `serializers.md` documentation to denote alternate use cases for `scope`. (@stratigos)
88
+ - [#2212](https://github.com/rails-api/active_model_serializers/pull/2212) Remove legacy has_many_embed_ids test. (@bf4)
89
+
90
+ ### [v0.10.6 (2017-05-01)](https://github.com/rails-api/active_model_serializers/compare/v0.10.5...v0.10.6)
91
+
92
+ Fixes:
93
+
94
+ - [#1857](https://github.com/rails-api/active_model_serializers/pull/1857) JSON:API does not load belongs_to relation to get identifier id. (@bf4)
95
+ - [#2119](https://github.com/rails-api/active_model_serializers/pull/2119) JSON:API returns null resource object identifier when 'id' is null. (@bf4)
96
+ - [#2093](https://github.com/rails-api/active_model_serializers/pull/2093) undef problematic Serializer methods: display, select. (@bf4)
97
+
98
+ Misc:
99
+
100
+ - [#2104](https://github.com/rails-api/active_model_serializers/pull/2104) Documentation for serializers and rendering. (@cassidycodes)
101
+ - [#2081](https://github.com/rails-api/active_model_serializers/pull/2081) Documentation for `include` option in adapters. (@charlie-wasp)
102
+ - [#2120](https://github.com/rails-api/active_model_serializers/pull/2120) Documentation for association options: foreign_key, type, class_name, namespace. (@bf4)
103
+
104
+ ### [v0.10.5 (2017-03-07)](https://github.com/rails-api/active_model_serializers/compare/v0.10.4...v0.10.5)
105
+
106
+ Breaking changes:
107
+
108
+ Features:
109
+
110
+ - [#2021](https://github.com/rails-api/active_model_serializers/pull/2021) ActiveModelSerializers::Model#attributes. Originally in [#1982](https://github.com/rails-api/active_model_serializers/pull/1982). (@bf4)
111
+ - [#2057](https://github.com/rails-api/active_model_serializers/pull/2057)
112
+ Update version constraint for jsonapi-renderer to `['>= 0.1.1.beta1', '< 0.2']`
113
+ (@jaredbeck)
114
+
115
+ Fixes:
116
+
117
+ - [#2022](https://github.com/rails-api/active_model_serializers/pull/2022) Mutation of ActiveModelSerializers::Model now changes the attributes. Originally in [#1984](https://github.com/rails-api/active_model_serializers/pull/1984). (@bf4)
118
+
119
+ Misc:
120
+
121
+ - [#2055](https://github.com/rails-api/active_model_serializers/pull/2055)
122
+ Replace deprecated dependency jsonapi with jsonapi-renderer. (@jaredbeck)
123
+ - [#2021](https://github.com/rails-api/active_model_serializers/pull/2021) Make test attributes explicit. Tests have Model#associations. (@bf4)
124
+ - [#1981](https://github.com/rails-api/active_model_serializers/pull/1981) Fix relationship link documentation. (@groyoh)
125
+ - [#2035](https://github.com/rails-api/active_model_serializers/pull/2035) Document how to disable the logger. (@MSathieu)
126
+ - [#2039](https://github.com/rails-api/active_model_serializers/pull/2039) Documentation fixes. (@biow0lf)
127
+
128
+ ### [v0.10.4 (2017-01-06)](https://github.com/rails-api/active_model_serializers/compare/v0.10.3...v0.10.4)
129
+
130
+ Misc:
131
+
132
+ - [#2005](https://github.com/rails-api/active_model_serializers/pull/2005) Update jsonapi runtime dependency to 0.1.1.beta6, support Ruby 2.4. (@kofronpi)
133
+ - [#1993](https://github.com/rails-api/active_model_serializers/pull/1993) Swap out KeyTransform for CaseTransform gem for the possibility of native extension use. (@NullVoxPopuli)
134
+
135
+ ### [v0.10.3 (2016-11-21)](https://github.com/rails-api/active_model_serializers/compare/v0.10.2...v0.10.3)
136
+
137
+ Fixes:
138
+
139
+ - [#1973](https://github.com/rails-api/active_model_serializers/pull/1973) Fix namespace lookup for collections and has_many relationships (@groyoh)
140
+ - [#1887](https://github.com/rails-api/active_model_serializers/pull/1887) Make the comment reflect what the function does (@johnnymo87)
141
+ - [#1890](https://github.com/rails-api/active_model_serializers/issues/1890) Ensure generator inherits from ApplicationSerializer when available (@richmolj)
142
+ - [#1922](https://github.com/rails-api/active_model_serializers/pull/1922) Make railtie an optional dependency in runtime (@ggpasqualino)
143
+ - [#1930](https://github.com/rails-api/active_model_serializers/pull/1930) Ensure valid jsonapi when relationship has no links or data (@richmolj)
144
+
145
+ Features:
146
+
147
+ - [#1757](https://github.com/rails-api/active_model_serializers/pull/1757) Make serializer lookup chain configurable. (@NullVoxPopuli)
148
+ - [#1968](https://github.com/rails-api/active_model_serializers/pull/1968) (@NullVoxPopuli)
149
+ - Add controller namespace to default controller lookup
150
+ - Provide a `namespace` render option
151
+ - document how set the namespace in the controller for implicit lookup.
152
+ - [#1791](https://github.com/rails-api/active_model_serializers/pull/1791) (@bf4, @youroff, @NullVoxPopuli)
153
+ - Added `jsonapi_namespace_separator` config option.
154
+ - [#1889](https://github.com/rails-api/active_model_serializers/pull/1889) Support key transformation for Attributes adapter (@iancanderson, @danbee)
155
+ - [#1917](https://github.com/rails-api/active_model_serializers/pull/1917) Add `jsonapi_pagination_links_enabled` configuration option (@richmolj)
156
+ - [#1797](https://github.com/rails-api/active_model_serializers/pull/1797) Only include 'relationships' when sideloading (@richmolj)
157
+
158
+ Fixes:
159
+
160
+ - [#1833](https://github.com/rails-api/active_model_serializers/pull/1833) Remove relationship links if they are null (@groyoh)
161
+ - [#1881](https://github.com/rails-api/active_model_serializers/pull/1881) ActiveModelSerializers::Model correctly works with string keys (@yevhene)
162
+
163
+ Misc:
164
+ - [#1767](https://github.com/rails-api/active_model_serializers/pull/1767) Replace raising/rescuing `CollectionSerializer::NoSerializerError`,
165
+ throw/catch `:no_serializer`. (@bf4)
166
+ - [#1839](https://github.com/rails-api/active_model_serializers/pull/1839) `fields` tests demonstrating usage for both attributes and relationships. (@NullVoxPopuli)
167
+ - [#1812](https://github.com/rails-api/active_model_serializers/pull/1812) add a code of conduct (@corainchicago)
168
+
169
+ - [#1878](https://github.com/rails-api/active_model_serializers/pull/1878) Cache key generation for serializers now uses `ActiveSupport::Cache.expand_cache_key` instead of `Array#join` by default and is also overridable. This change should be backward-compatible. (@markiz)
170
+
171
+ - [#1799](https://github.com/rails-api/active_model_serializers/pull/1799) Add documentation for setting the adapter. (@cassidycodes)
172
+ - [#1909](https://github.com/rails-api/active_model_serializers/pull/1909) Add documentation for relationship links. (@vasilakisfil, @NullVoxPopuli)
173
+ - [#1959](https://github.com/rails-api/active_model_serializers/pull/1959) Add documentation for root. (@shunsuke227ono)
174
+ - [#1967](https://github.com/rails-api/active_model_serializers/pull/1967) Improve type method documentation. (@yukideluxe)
175
+
176
+ ### [v0.10.2 (2016-07-05)](https://github.com/rails-api/active_model_serializers/compare/v0.10.1...v0.10.2)
177
+
178
+ Fixes:
179
+ - [#1814](https://github.com/rails-api/active_model_serializers/pull/1814) Ensuring read_multi works with fragment cache
180
+ - [#1848](https://github.com/rails-api/active_model_serializers/pull/1848) Redefine associations on inherited serializers. (@EhsanYousefi)
181
+
182
+ Misc:
183
+ - [#1808](https://github.com/rails-api/active_model_serializers/pull/1808) Adds documentation for `fields` option. (@luizkowalski)
184
+
185
+ ### [v0.10.1 (2016-06-16)](https://github.com/rails-api/active_model_serializers/compare/v0.10.0...v0.10.1)
186
+
187
+ Features:
188
+ - [#1668](https://github.com/rails-api/active_model_serializers/pull/1668) Exclude nil and empty links. (@sigmike)
189
+ - [#1426](https://github.com/rails-api/active_model_serializers/pull/1426) Add ActiveModelSerializers.config.default_includes (@empact)
190
+
191
+ Fixes:
192
+ - [#1754](https://github.com/rails-api/active_model_serializers/pull/1754) Fixes #1759, Grape integration, improves serialization_context
193
+ missing error message on pagination. Document overriding CollectionSerializer#paginated?. (@bf4)
194
+ Moved serialization_context creation to Grape formatter, so resource serialization works without explicit calls to the `render` helper method.
195
+ Added Grape collection tests. (@onomated)
196
+ - [#1287](https://github.com/rails-api/active_model_serializers/pull/1287) Pass `fields` options from adapter to serializer. (@vasilakisfil)
197
+ - [#1710](https://github.com/rails-api/active_model_serializers/pull/1710) Prevent association loading when `include_data` option
198
+ is set to `false`. (@groyoh)
199
+ - [#1747](https://github.com/rails-api/active_model_serializers/pull/1747) Improve jsonapi mime type registration for Rails 5 (@remear)
200
+
201
+ Misc:
202
+ - [#1734](https://github.com/rails-api/active_model_serializers/pull/1734) Adds documentation for conditional attribute (@lambda2)
203
+ - [#1685](https://github.com/rails-api/active_model_serializers/pull/1685) Replace `IncludeTree` with `IncludeDirective` from the jsonapi gem.
204
+
205
+ ### [v0.10.0 (2016-05-17)](https://github.com/rails-api/active_model_serializers/compare/4a2d9853ba7...v0.10.0)
206
+
207
+ Breaking changes:
208
+ - [#1662](https://github.com/rails-api/active_model_serializers/pull/1662) Drop support for Rails 4.0 and Ruby 2.0.0. (@remear)
209
+
210
+ Features:
211
+ - [#1677](https://github.com/rails-api/active_model_serializers/pull/1677) Add `assert_schema`, `assert_request_schema`, `assert_request_response_schema`. (@bf4)
212
+ - [#1697](https://github.com/rails-api/active_model_serializers/pull/1697) Include actual exception message with custom exceptions;
213
+ `Test::Schema` exceptions are now `Minitest::Assertion`s. (@bf4)
214
+ - [#1699](https://github.com/rails-api/active_model_serializers/pull/1699) String/Lambda support for conditional attributes/associations (@mtsmfm)
215
+ - [#1687](https://github.com/rails-api/active_model_serializers/pull/1687) Only calculate `_cache_digest` (in `cache_key`) when `skip_digest` is false. (@bf4)
216
+ - [#1647](https://github.com/rails-api/active_model_serializers/pull/1647) Restrict usage of `serializable_hash` options
217
+ to the ActiveModel::Serialization and ActiveModel::Serializers::JSON interface. (@bf4)
218
+
219
+ Fixes:
220
+ - [#1700](https://github.com/rails-api/active_model_serializers/pull/1700) Support pagination link for Kaminari when no data is returned. (@iamnader)
221
+ - [#1726](https://github.com/rails-api/active_model_serializers/pull/1726) Adds polymorphic option to association definition which includes association type/nesting in serializer (@cgmckeever)
222
+
223
+ Misc:
224
+ - [#1673](https://github.com/rails-api/active_model_serializers/pull/1673) Adds "How to" guide on using AMS with POROs (@DrSayre)
225
+ - [#1730](https://github.com/rails-api/active_model_serializers/pull/1730) Adds documentation for overriding default serializer based on conditions (@groyoh/@cgmckeever)
226
+
227
+ ### [v0.10.0.rc5 (2016-04-04)](https://github.com/rails-api/active_model_serializers/compare/v0.10.0.rc4...v0.10.0.rc5)
228
+
229
+ Breaking changes:
230
+
231
+ - [#1645](https://github.com/rails-api/active_model_serializers/pull/1645) Changed :dashed key transform to :dash. (@remear)
232
+ - [#1574](https://github.com/rails-api/active_model_serializers/pull/1574) Default key case for the JsonApi adapter changed to dashed. (@remear)
233
+
234
+ Features:
235
+ - [#1645](https://github.com/rails-api/active_model_serializers/pull/1645) Transform keys referenced in values. (@remear)
236
+ - [#1650](https://github.com/rails-api/active_model_serializers/pull/1650) Fix serialization scope options `scope`, `scope_name`
237
+ take precedence over `serialization_scope` in the controller.
238
+ Fix tests that required tearing down dynamic methods. (@bf4)
239
+ - [#1644](https://github.com/rails-api/active_model_serializers/pull/1644) Include adapter name in cache key so
240
+ that the same serializer can be cached per adapter. (@bf4 via #1346 by @kevintyll)
241
+ - [#1642](https://github.com/rails-api/active_model_serializers/pull/1642) Prefer object.cache_key over the generated
242
+ cache key. (@bf4 via #1346 by @kevintyll)
243
+ - [#1637](https://github.com/rails-api/active_model_serializers/pull/1637) Make references to 'ActionController::Base.cache_store' explicit
244
+ in order to avoid issues when application controllers inherit from 'ActionController::API'. (@ncuesta)
245
+ - [#1633](https://github.com/rails-api/active_model_serializers/pull/1633) Yield 'serializer' to serializer association blocks. (@bf4)
246
+ - [#1616](https://github.com/rails-api/active_model_serializers/pull/1616) SerializableResource handles no serializer like controller. (@bf4)
247
+ - [#1618](https://github.com/rails-api/active_model_serializers/issues/1618) Get collection root key for
248
+ empty collection from explicit serializer option, when possible. (@bf4)
249
+ - [#1574](https://github.com/rails-api/active_model_serializers/pull/1574) Provide key translation. (@remear)
250
+ - [#1494](https://github.com/rails-api/active_model_serializers/pull/1494) Make serializers serializalbe
251
+ (using the Attributes adapter by default). (@bf4)
252
+ - [#1550](https://github.com/rails-api/active_model_serializers/pull/1550) Add
253
+ Rails url_helpers to `SerializationContext` for use in links. (@remear, @bf4)
254
+ - [#1004](https://github.com/rails-api/active_model_serializers/pull/1004) JSON API errors object implementation.
255
+ - Only implements `detail` and `source` as derived from `ActiveModel::Error`
256
+ - Provides checklist of remaining questions and remaining parts of the spec.
257
+ - [#1515](https://github.com/rails-api/active_model_serializers/pull/1515) Adds support for symbols to the
258
+ `ActiveModel::Serializer.type` method. (@groyoh)
259
+ - [#1504](https://github.com/rails-api/active_model_serializers/pull/1504) Adds the changes missing from #1454
260
+ and add more tests for resource identifier and relationship objects. Fix association block with link
261
+ returning `data: nil`.(@groyoh)
262
+ - [#1372](https://github.com/rails-api/active_model_serializers/pull/1372) Support
263
+ cache_store.read_multi. (@LcpMarvel)
264
+ - [#1018](https://github.com/rails-api/active_model_serializers/pull/1018) Add more tests and docs for top-level links. (@leandrocp)
265
+ - [#1454](https://github.com/rails-api/active_model_serializers/pull/1454) Add support for
266
+ relationship-level links and meta attributes. (@beauby)
267
+ - [#1340](https://github.com/rails-api/active_model_serializers/pull/1340) Add support for resource-level meta. (@beauby)
268
+
269
+ Fixes:
270
+ - [#1657](https://github.com/rails-api/active_model_serializers/pull/1657) Add missing missing require "active_support/json". (@andreaseger)
271
+ - [#1661](https://github.com/rails-api/active_model_serializers/pull/1661) Fixes `read_attribute_for_serialization` not
272
+ seeing methods defined in serialization superclass (#1653, #1658, #1660), introduced in #1650. (@bf4)
273
+ - [#1651](https://github.com/rails-api/active_model_serializers/pull/1651) Fix deserialization of nil relationships. (@NullVoxPopuli)
274
+ - [#1480](https://github.com/rails-api/active_model_serializers/pull/1480) Fix setting of cache_store from Rails configuration. (@bf4)
275
+ Fix unintentional mutating of value in memory cache store. (@groyoh)
276
+ - [#1622](https://github.com/rails-api/active_model_serializers/pull/1622) Fragment cache changed from per-record to per-serializer.
277
+ Now, two serializers that use the same model may be separately cached. (@lserman)
278
+ - [#1478](https://github.com/rails-api/active_model_serializers/pull/1478) Cache store will now be correctly set when serializers are
279
+ loaded *before* Rails initializes. (@bf4)
280
+ - [#1570](https://github.com/rails-api/active_model_serializers/pull/1570) Fixed pagination issue with last page size. (@bmorrall)
281
+ - [#1516](https://github.com/rails-api/active_model_serializers/pull/1516) No longer return a nil href when only
282
+ adding meta to a relationship link. (@groyoh)
283
+ - [#1458](https://github.com/rails-api/active_model_serializers/pull/1458) Preserve the serializer
284
+ type when fragment caching. (@bdmac)
285
+ - [#1477](https://github.com/rails-api/active_model_serializers/pull/1477) Fix `fragment_cached?`
286
+ method to check if caching. (@bdmac)
287
+ - [#1501](https://github.com/rails-api/active_model_serializers/pull/1501) Adds tests for SerializableResource::use_adapter?,doc typos (@domitian)
288
+ - [#1488](https://github.com/rails-api/active_model_serializers/pull/1488) Require ActiveSupport's string inflections (@nate00)
289
+
290
+ Misc:
291
+ - [#1608](https://github.com/rails-api/active_model_serializers/pull/1608) Move SerializableResource to ActiveModelSerializers (@groyoh)
292
+ - [#1602](https://github.com/rails-api/active_model_serializers/pull/1602) Add output examples to Adapters docs (@remear)
293
+ - [#1557](https://github.com/rails-api/active_model_serializers/pull/1557) Update docs regarding overriding the root key (@Jwan622)
294
+ - [#1471](https://github.com/rails-api/active_model_serializers/pull/1471) [Cleanup] Serializer caching is its own concern. (@bf4)
295
+ - [#1482](https://github.com/rails-api/active_model_serializers/pull/1482) Document JSON API implementation defs and progress in class. (@bf4)
296
+ - [#1551](https://github.com/rails-api/active_model_serializers/pull/1551) Added codebeat badge (@korzonek)
297
+ - [#1527](https://github.com/rails-api/active_model_serializers/pull/1527) Refactor fragment cache class. (@groyoh)
298
+ - [#1560](https://github.com/rails-api/active_model_serializers/pull/1560) Update rubocop and address its warnings. (@bf4 @groyoh)
299
+ - [#1545](https://github.com/rails-api/active_model_serializers/pull/1545) Document how to pass arbitrary options to the
300
+ serializer (@CodedBeardedSignedTaylor)
301
+ - [#1496](https://github.com/rails-api/active_model_serializers/pull/1496) Run all branches against JRuby on CI (@nadavshatz)
302
+ - [#1559](https://github.com/rails-api/active_model_serializers/pull/1559) Add a deprecation DSL. (@bf4 @groyoh)
303
+ - [#1543](https://github.com/rails-api/active_model_serializers/pull/1543) Add the changes missing from #1535. (@groyoh)
304
+ - [#1535](https://github.com/rails-api/active_model_serializers/pull/1535) Move the adapter and adapter folder to
305
+ active_model_serializers folder and changes the module namespace. (@domitian @bf4)
306
+ - [#1497](https://github.com/rails-api/active_model_serializers/pull/1497) Add JRuby-9000 to appveyor.yml(@corainchicago)
307
+ - [#1420](https://github.com/rails-api/active_model_serializers/pull/1420) Adds tests and documentation for polymorphism(@marcgarreau)
308
+
309
+
310
+ ### [v0.10.0.rc4 (2016-01-27)](https://github.com/rails-api/active_model_serializers/compare/v0.10.0.rc3...v0.10.0.rc4)
311
+ Breaking changes:
312
+
313
+ - [#1360](https://github.com/rails-api/active_model_serializers/pull/1360)
314
+ [#1369](https://github.com/rails-api/active_model_serializers/pull/1369) Drop support for Ruby 1.9.3 (@karaAJC, @maurogeorge)
315
+ - [#1131](https://github.com/rails-api/active_model_serializers/pull/1131) Remove Serializer#root_name (@beauby)
316
+ - [#1138](https://github.com/rails-api/active_model_serializers/pull/1138) Introduce Adapter::Base (@bf4)
317
+ * Adapters now inherit Adapter::Base. 'Adapter' is now a module, no longer a class.
318
+ * using a class as a namespace that you also inherit from is complicated and circular at times i.e.
319
+ buggy (see https://github.com/rails-api/active_model_serializers/pull/1177)
320
+ * The class methods on Adapter aren't necessarily related to the instance methods, they're more
321
+ Adapter functions.
322
+ * named `Base` because it's a Rails-ism.
323
+ * It helps to isolate and highlight what the Adapter interface actually is.
324
+ - [#1418](https://github.com/rails-api/active_model_serializers/pull/1418)
325
+ serialized collections now use the root option as is; now, only the
326
+ root derived from the serializer or object is always pluralized.
327
+
328
+ Features:
329
+
330
+ - [#1406](https://github.com/rails-api/active_model_serializers/pull/1406) Allow for custom dynamic values in JSON API links (@beauby)
331
+ - [#1270](https://github.com/rails-api/active_model_serializers/pull/1270) Adds `assert_response_schema` test helper (@maurogeorge)
332
+ - [#1099](https://github.com/rails-api/active_model_serializers/pull/1099) Adds `assert_serializer` test helper (@maurogeorge)
333
+ - [#1403](https://github.com/rails-api/active_model_serializers/pull/1403) Add support for if/unless on attributes/associations (@beauby)
334
+ - [#1248](https://github.com/rails-api/active_model_serializers/pull/1248) Experimental: Add support for JSON API deserialization (@beauby)
335
+ - [#1378](https://github.com/rails-api/active_model_serializers/pull/1378) Change association blocks
336
+ to be evaluated in *serializer* scope, rather than *association* scope. (@bf4)
337
+ * Syntax changes from e.g.
338
+ `has_many :titles do customers.pluck(:title) end` (in #1356) to
339
+ `has_many :titles do object.customers.pluck(:title) end`
340
+ - [#1356](https://github.com/rails-api/active_model_serializers/pull/1356) Add inline syntax for
341
+ attributes and associations (@bf4 @beauby @noahsilas)
342
+ * Allows defining attributes so that they don't conflict with existing methods. e.g. `attribute
343
+ :title do 'Mr. Topum Hat' end`
344
+ * Allows defining associations so that they don't conflict with existing methods. e.g. `has_many
345
+ :titles do customers.pluck(:title) end`
346
+ * Allows dynamic associations, as compared to compare to using
347
+ [`virtual_value`](https://github.com/rails-api/active_model_serializers/pull/1356#discussion_r47146466).
348
+ e.g. `has_many :reviews, virtual_value: [{ id: 1 }, { id: 2 }]`
349
+ * Removes dynamically defined methods on the serializer
350
+ - [#1336](https://github.com/rails-api/active_model_serializers/pull/1336) Added support for Grape >= 0.13, < 1.0 (@johnhamelink)
351
+ - [#1322](https://github.com/rails-api/active_model_serializers/pull/1322) Instrumenting rendering of resources (@bf4, @maurogeorge)
352
+ - [#1291](https://github.com/rails-api/active_model_serializers/pull/1291) Add logging (@maurogeorge)
353
+ - [#1272](https://github.com/rails-api/active_model_serializers/pull/1272) Add PORO serializable base class: ActiveModelSerializers::Model (@bf4)
354
+ - [#1255](https://github.com/rails-api/active_model_serializers/pull/1255) Make more class attributes inheritable (@bf4)
355
+ - [#1249](https://github.com/rails-api/active_model_serializers/pull/1249) Inheritance of serializer inheriting the cache configuration(@Rodrigora)
356
+ - [#1247](https://github.com/rails-api/active_model_serializers/pull/1247) Add support for toplevel JSON API links (@beauby)
357
+ - [#1246](https://github.com/rails-api/active_model_serializers/pull/1246) Add support for resource-level JSON API links (@beauby)
358
+ - [#1225](https://github.com/rails-api/active_model_serializers/pull/1225) Better serializer lookup, use nested serializer when it exists (@beauby)
359
+ - [#1213](https://github.com/rails-api/active_model_serializers/pull/1213) `type` directive for serializer to control type field with json-api adapter (@youroff)
360
+ - [#1172](https://github.com/rails-api/active_model_serializers/pull/1172) Better serializer registration, get more than just the first module (@bf4)
361
+ - [#1158](https://github.com/rails-api/active_model_serializers/pull/1158) Add support for wildcards in `include` option (@beauby)
362
+ - [#1127](https://github.com/rails-api/active_model_serializers/pull/1127) Add support for nested
363
+ associations for JSON and Attributes adapters via the `include` option (@NullVoxPopuli, @beauby).
364
+ - [#1050](https://github.com/rails-api/active_model_serializers/pull/1050) Add support for toplevel jsonapi member (@beauby, @bf4)
365
+ - [#1251](https://github.com/rails-api/active_model_serializers/pull/1251) Rename ArraySerializer to
366
+ CollectionSerializer for clarity, add ActiveModelSerializers.config.collection_serializer (@bf4)
367
+ - [#1295](https://github.com/rails-api/active_model_serializers/pull/1295) Add config `serializer_lookup_enabled` that,
368
+ when disabled, requires serializers to explicitly specified. (@trek)
369
+
370
+ Fixes:
371
+
372
+ - [#1352](https://github.com/rails-api/active_model_serializers/pull/1352) Fix generators; Isolate Rails-specifc code in Railties (@dgynn, @bf4)
373
+ - [#1384](https://github.com/rails-api/active_model_serializers/pull/1384)Fix database state leaking across tests (@bf4)
374
+ - [#1297](https://github.com/rails-api/active_model_serializers/pull/1297) Fix `fields` option to restrict relationships as well (@beauby)
375
+ - [#1239](https://github.com/rails-api/active_model_serializers/pull/1239) Fix duplicates in JSON API compound documents (@beauby)
376
+ - [#1214](https://github.com/rails-api/active_model_serializers/pull/1214) retrieve the key from the reflection options when building associations (@NullVoxPopuli, @hut8)
377
+ - [#1358](https://github.com/rails-api/active_model_serializers/pull/1358) Handle serializer file paths with spaces (@rwstauner, @bf4)
378
+ - [#1195](https://github.com/rails-api/active_model_serializers/pull/1195) Fix id override (@beauby)
379
+ - [#1185](https://github.com/rails-api/active_model_serializers/pull/1185) Fix options passing in Json and Attributes adapters (@beauby)
380
+
381
+ Misc:
382
+
383
+ - [#1383](https://github.com/rails-api/active_model_serializers/pull/1383) Simplify reflections handling (@beauby)
384
+ - [#1370](https://github.com/rails-api/active_model_serializers/pull/1370) Simplify attributes handling via a mixin (@beauby)
385
+ - [#1301](https://github.com/rails-api/active_model_serializers/pull/1301) Mapping JSON API spec / schema to AMS (@bf4)
386
+ - [#1271](https://github.com/rails-api/active_model_serializers/pull/1271) Handle no serializer source file to digest (@bf4)
387
+ - [#1260](https://github.com/rails-api/active_model_serializers/pull/1260) Serialization and Cache Documentation (@bf4)
388
+ - [#1259](https://github.com/rails-api/active_model_serializers/pull/1259) Add more info to CONTRIBUTING (@bf4)
389
+ - [#1233](https://github.com/rails-api/active_model_serializers/pull/1233) Top-level meta and meta_key options no longer handled at serializer level (@beauby)
390
+ - [#1232](https://github.com/rails-api/active_model_serializers/pull/1232) fields option no longer handled at serializer level (@beauby)
391
+ - [#1220](https://github.com/rails-api/active_model_serializers/pull/1220) Remove empty rubocop.rake (@maurogeorge)
392
+ - [#1178](https://github.com/rails-api/active_model_serializers/pull/1178) env CAPTURE_STDERR=false lets devs see hard failures (@bf4)
393
+ - [#1177](https://github.com/rails-api/active_model_serializers/pull/1177) Remove Adapter autoloads in favor of require (@bf4)
394
+ - [#1117](https://github.com/rails-api/active_model_serializers/pull/1117) FlattenJson adapter no longer inherits Json adapter, renamed to Attributes (@bf4)
395
+ - [#1171](https://github.com/rails-api/active_model_serializers/pull/1171) add require statements to top of file (@shicholas)
396
+ - [#1167](https://github.com/rails-api/active_model_serializers/pull/1167) Delegate Serializer.attributes to Serializer.attribute (@bf4)
397
+ - [#1174](https://github.com/rails-api/active_model_serializers/pull/1174) Consistently refer to the 'JSON API' and the 'JsonApi' adapter (@bf4)
398
+ - [#1173](https://github.com/rails-api/active_model_serializers/pull/1173) Comment private accessor warnings (@bf4)
399
+ - [#1166](https://github.com/rails-api/active_model_serializers/pull/1166) Prefer methods over instance variables (@bf4)
400
+ - [#1168](https://github.com/rails-api/active_model_serializers/pull/1168) Fix appveyor failure cache not being expired (@bf4)
401
+ - [#1161](https://github.com/rails-api/active_model_serializers/pull/1161) Remove duplicate test helper (@bf4)
402
+ - [#1360](https://github.com/rails-api/active_model_serializers/pull/1360) Update CI to test 2.2.2 -> 2.2.3 (@karaAJC)
403
+ - [#1371](https://github.com/rails-api/active_model_serializers/pull/1371) Refactor, update, create documentation (@bf4)
404
+
405
+ ### [v0.10.0.rc3 (2015-09-16)](https://github.com/rails-api/active_model_serializers/compare/v0.10.0.rc2...v0.10.0.rc3)
406
+ - [#1129](https://github.com/rails-api/active_model_serializers/pull/1129) Remove SerializableResource.serialize in favor of `.new` (@bf4)
407
+ - [#1155](https://github.com/rails-api/active_model_serializers/pull/1155) Outside controller use tutorial (@CodedBeardedSignedTaylor)
408
+ - [#1154](https://github.com/rails-api/active_model_serializers/pull/1154) Rubocop fixes for issues introduced by #1089 (@NullVoxPopuli)
409
+ - [#1089](https://github.com/rails-api/active_model_serializers/pull/1089) Add ActiveModelSerializers.logger with default null device (@bf4)
410
+ - [#1109](https://github.com/rails-api/active_model_serializers/pull/1109) Make better use of Minitest's lifecycle (@bf4)
411
+ - [#1144](https://github.com/rails-api/active_model_serializers/pull/1144) Fix Markdown to adapters documentation (@bacarini)
412
+ - [#1121](https://github.com/rails-api/active_model_serializers/pull/1121) Refactor `add_links` in JSONAPI adapter. (@beauby)
413
+ - [#1150](https://github.com/rails-api/active_model_serializers/pull/1150) Remove legacy method accidentally reintroduced in #1017 (@beauby)
414
+ - [#1149](https://github.com/rails-api/active_model_serializers/pull/1149) Update README with nested included association example. (@mattmueller)
415
+ - [#1110](https://github.com/rails-api/active_model_serializers/pull/1110) Add lint tests for AR models (@beauby)
416
+ - [#1131](https://github.com/rails-api/active_model_serializers/pull/1131) Extended format for JSONAPI `include` option (@beauby)
417
+ * adds extended format for `include` option to JsonApi adapter
418
+ - [#1142](https://github.com/rails-api/active_model_serializers/pull/1142) Updating wording on cache expiry in README (@leighhalliday)
419
+ - [#1140](https://github.com/rails-api/active_model_serializers/pull/1140) Fix typo in fieldset exception (@lautis)
420
+ - [#1132](https://github.com/rails-api/active_model_serializers/pull/1132) Get rid of unnecessary instance variables, and implied dependencies. (@beauby)
421
+ - [#1139](https://github.com/rails-api/active_model_serializers/pull/1139) Documentation for serializing resources without render (@PericlesTheo)
422
+ - [#1017](https://github.com/rails-api/active_model_serializers/pull/1017) Make Adapters registerable so they are not namespace-constrained (@bf4)
423
+ - [#1120](https://github.com/rails-api/active_model_serializers/pull/1120) Add windows platform to loading sqlite3 (@Eric-Guo)
424
+ - [#1123](https://github.com/rails-api/active_model_serializers/pull/1123) Remove url options (@bacarini)
425
+ - [#1093](https://github.com/rails-api/active_model_serializers/pull/1093) Factor `with_adapter` + force cache clear before each test. (@beauby)
426
+ - [#1095](https://github.com/rails-api/active_model_serializers/pull/1095) Add documentation about configuration options. (@beauby)
427
+ - [#1069](https://github.com/rails-api/active_model_serializers/pull/1069) Add test coverage; account for no artifacts on CI (@bf4)
428
+ - [#1103](https://github.com/rails-api/active_model_serializers/pull/1103) Move `id` and `json_api_type` methods from `Serializer` to `JsonApi`. (@beauby)
429
+ - [#1106](https://github.com/rails-api/active_model_serializers/pull/1106) Add Style enforcer (via Rubocop) (@bf4)
430
+ - [#1079](https://github.com/rails-api/active_model_serializers/pull/1079) Add ArraySerializer#object like Serializer (@bf4)
431
+ - [#1096](https://github.com/rails-api/active_model_serializers/pull/1096) Fix definition of serializer attributes with multiple calls to `attri… (@beauby)
432
+ - [#1105](https://github.com/rails-api/active_model_serializers/pull/1105) Add ActiveRecord-backed fixtures. (@beauby)
433
+ - [#1108](https://github.com/rails-api/active_model_serializers/pull/1108) Better lint (@bf4)
434
+ - [#1102](https://github.com/rails-api/active_model_serializers/pull/1102) Remove remains of `embed` option. (@beauby)
435
+ - [#1090](https://github.com/rails-api/active_model_serializers/pull/1090) Clarify AMS dependencies (@bf4)
436
+ - [#1081](https://github.com/rails-api/active_model_serializers/pull/1081) Add configuration option to set resource type to singular/plural (@beauby)
437
+ - [#1067](https://github.com/rails-api/active_model_serializers/pull/1067) Fix warnings (@bf4)
438
+ - [#1066](https://github.com/rails-api/active_model_serializers/pull/1066) Adding appveyor to the project (@joaomdmoura, @Eric-Guo, @bf4)
439
+ - [#1071](https://github.com/rails-api/active_model_serializers/pull/1071) Make testing suite running and pass in Windows (@Eric-Guo, @bf4)
440
+ - [#1041](https://github.com/rails-api/active_model_serializers/pull/1041) Adding pagination links (@bacarini)
441
+ * adds support for `pagination links` at top level of JsonApi adapter
442
+ - [#1063](https://github.com/rails-api/active_model_serializers/pull/1063) Lead by example: lint PORO model (@bf4)
443
+ - [#1](https://github.com/rails-api/active_model_serializers/pull/1) Test caller line parsing and digesting (@bf4)
444
+ - [#1048](https://github.com/rails-api/active_model_serializers/pull/1048) Let FlattenJson adapter decide it doesn't include meta (@bf4)
445
+ - [#1060](https://github.com/rails-api/active_model_serializers/pull/1060) Update fragment cache to support namespaced objects (@aaronlerch)
446
+ - [#1052](https://github.com/rails-api/active_model_serializers/pull/1052) Use underscored json_root when serializing a collection (@whatthewhat)
447
+ - [#1051](https://github.com/rails-api/active_model_serializers/pull/1051) Fix some invalid JSON in docs (@tjschuck)
448
+ - [#1049](https://github.com/rails-api/active_model_serializers/pull/1049) Fix incorrect s/options = {}/options ||= {} (@bf4)
449
+ - [#1037](https://github.com/rails-api/active_model_serializers/pull/1037) allow for type attribute (@lanej)
450
+ - [#1034](https://github.com/rails-api/active_model_serializers/pull/1034) allow id attribute to be overriden (@lanej)
451
+ - [#1035](https://github.com/rails-api/active_model_serializers/pull/1035) Fixed Comments highlight (@artLopez)
452
+ - [#1031](https://github.com/rails-api/active_model_serializers/pull/1031) Disallow to define multiple associations at once (@bolshakov)
453
+ - [#1032](https://github.com/rails-api/active_model_serializers/pull/1032) Wrap railtie requirement with rescue (@elliotlarson)
454
+ - [#1026](https://github.com/rails-api/active_model_serializers/pull/1026) Bump Version Number to 0.10.0.rc2 (@jfelchner)
455
+ - [#985](https://github.com/rails-api/active_model_serializers/pull/985) Associations implementation refactoring (@bolshakov)
456
+ - [#954](https://github.com/rails-api/active_model_serializers/pull/954) Encapsulate serialization in ActiveModel::SerializableResource (@bf4)
457
+ - [#972](https://github.com/rails-api/active_model_serializers/pull/972) Capture app warnings on test run (@bf4)
458
+ - [#1019](https://github.com/rails-api/active_model_serializers/pull/1019) Improve README.md (@baojjeu)
459
+ - [#998](https://github.com/rails-api/active_model_serializers/pull/998) Changing root to model class name (@joaomdmoura)
460
+ - [#1006](https://github.com/rails-api/active_model_serializers/pull/1006) Fix adapter inflection bug for api -> API (@bf4)
461
+ - [#1016](https://github.com/rails-api/active_model_serializers/pull/1016) require rails/railtie before subclassing Rails::Railtie (@bf4)
462
+ - [#1013](https://github.com/rails-api/active_model_serializers/pull/1013) Root option with empty array support (@vyrak, @mareczek)
463
+ - [#994](https://github.com/rails-api/active_model_serializers/pull/994) Starting Docs structure (@joaomdmoura)
464
+ - [#1007](https://github.com/rails-api/active_model_serializers/pull/1007) Bug fix for ArraySerializer json_key (@jiajiawang)
465
+ - [#1003](https://github.com/rails-api/active_model_serializers/pull/1003) Fix transient test failures (@Rodrigora)
466
+ - [#996](https://github.com/rails-api/active_model_serializers/pull/996) Add linter for serializable resource (@bf4)
467
+ - [#990](https://github.com/rails-api/active_model_serializers/pull/990) Adding json-api meta test (@joaomdmoura)
468
+ - [#984](https://github.com/rails-api/active_model_serializers/pull/984) Add option "key" to serializer associations (@Rodrigora)
469
+ - [#982](https://github.com/rails-api/active_model_serializers/pull/982) Fix typo (@bf4)
470
+ - [#981](https://github.com/rails-api/active_model_serializers/pull/981) Remove unused PORO#to_param (@bf4)
471
+ - [#978](https://github.com/rails-api/active_model_serializers/pull/978) fix generators template bug (@regonn)
472
+ - [#975](https://github.com/rails-api/active_model_serializers/pull/975) Fixes virtual value not being used (@GriffinHeart)
473
+ - [#970](https://github.com/rails-api/active_model_serializers/pull/970) Fix transient tests failures (@Rodrigora)
474
+ - [#962](https://github.com/rails-api/active_model_serializers/pull/962) Rendering objects that doesn't have serializers (@bf4, @joaomdmoura, @JustinAiken)
475
+ - [#939](https://github.com/rails-api/active_model_serializers/pull/939) Use a more precise generated cache key (@aaronlerch)
476
+ - [#971](https://github.com/rails-api/active_model_serializers/pull/971) Restore has_one to generator (@bf4)
477
+ - [#965](https://github.com/rails-api/active_model_serializers/pull/965) options fedault valueserializable_hash and as_json (@bf4)
478
+ - [#959](https://github.com/rails-api/active_model_serializers/pull/959) TYPO on README.md (@kangkyu)
479
+
480
+ ### [v0.10.0.rc2 (2015-06-16)](https://github.com/rails-api/active_model_serializers/compare/v0.10.0.rc1...v0.10.0.rc2)
481
+ - [#958](https://github.com/rails-api/active_model_serializers/pull/958) Splitting json adapter into two (@joaomdmoura)
482
+ * adds FlattenJSON as default adapter
483
+ - [#953](https://github.com/rails-api/active_model_serializers/pull/953) use model name to determine the type (@lsylvester)
484
+ * uses model name to determine the type
485
+ - [#949](https://github.com/rails-api/active_model_serializers/pull/949) Don't pass serializer option to associated serializers (@bf4, @edwardloveall)
486
+ - [#902](https://github.com/rails-api/active_model_serializers/pull/902) Added serializer file digest to the cache_key (@cristianbica)
487
+ - [#948](https://github.com/rails-api/active_model_serializers/pull/948) AMS supports JSONAPI 1.0 instead of RC4 (@SeyZ)
488
+ - [#936](https://github.com/rails-api/active_model_serializers/pull/936) Include meta when using json adapter with custom root (@chrisbranson)
489
+ - [#942](https://github.com/rails-api/active_model_serializers/pull/942) Small code styling issue (@thiagofm)
490
+ - [#930](https://github.com/rails-api/active_model_serializers/pull/930) Reverting PR #909 (@joaomdmoura)
491
+ - [#924](https://github.com/rails-api/active_model_serializers/pull/924) Avoid unecessary calls to attribute methods when fragment caching (@navinpeiris)
492
+ - [#925](https://github.com/rails-api/active_model_serializers/pull/925) Updates JSON API Adapter to generate RC4 schema (@benedikt)
493
+ * adds JSON API support 1.0
494
+ - [#918](https://github.com/rails-api/active_model_serializers/pull/918) Adding rescue_with_handler to clear state (@ryansch)
495
+ - [#909](https://github.com/rails-api/active_model_serializers/pull/909) Defining Json-API Adapter as Default (@joaomdmoura)
496
+ * remove root key option and split JSON adapter
497
+ - [#914](https://github.com/rails-api/active_model_serializers/pull/914) Prevent possible duplicated attributes in serializer (@groyoh)
498
+ - [#880](https://github.com/rails-api/active_model_serializers/pull/880) Inabling subclasses serializers to inherit attributes (@groyoh)
499
+ - [#913](https://github.com/rails-api/active_model_serializers/pull/913) Avoiding the serializer option when instantiating a new one for ArraySerializer Fixed #911 (@groyoh)
500
+ - [#897](https://github.com/rails-api/active_model_serializers/pull/897) Allow to define custom serializer for given class (@imanel)
501
+ - [#892](https://github.com/rails-api/active_model_serializers/pull/892) Fixed a bug that appeared when json adapter serialize a nil association (@groyoh)
502
+ - [#895](https://github.com/rails-api/active_model_serializers/pull/895) Adding a test to cover 'meta' and 'meta_key' attr_readers (@adomokos)
503
+ - [#894](https://github.com/rails-api/active_model_serializers/pull/894) Fixing typos in README.md (@adomokos)
504
+ - [#888](https://github.com/rails-api/active_model_serializers/pull/888) Changed duplicated test name in action controller test (@groyoh)
505
+ - [#890](https://github.com/rails-api/active_model_serializers/pull/890) Remove unused method `def_serializer` (@JustinAiken)
506
+ - [#887](https://github.com/rails-api/active_model_serializers/pull/887) Fixing tests on JRuby (@joaomdmoura)
507
+ - [#885](https://github.com/rails-api/active_model_serializers/pull/885) Updates rails versions for test and dev (@tonyta)
508
+
509
+ ### [v0.10.0.rc1 (2015-04-22)](https://github.com/rails-api/active_model_serializers/compare/86fc7d7227f3ce538fcb28c1e8c7069ce311f0e1...v0.10.0.rc1)
510
+ - [#810](https://github.com/rails-api/active_model_serializers/pull/810) Adding Fragment Cache to AMS (@joaomdmoura)
511
+ * adds fragment cache support
512
+ - [#868](https://github.com/rails-api/active_model_serializers/pull/868) Fixed a bug that appears when a nil association is included (@groyoh)
513
+ - [#861](https://github.com/rails-api/active_model_serializers/pull/861) README: Add emphasis to single-word difference (@machty)
514
+ - [#858](https://github.com/rails-api/active_model_serializers/pull/858) Included resource fixes (@mateomurphy)
515
+ - [#853](https://github.com/rails-api/active_model_serializers/pull/853) RC3 Updates for JSON API (@mateomurphy)
516
+ - [#852](https://github.com/rails-api/active_model_serializers/pull/852) Fix options merge order in `each_association` (@mateomurphy)
517
+ - [#850](https://github.com/rails-api/active_model_serializers/pull/850) Use association value for determining serializer used (@mateomurphy)
518
+ - [#843](https://github.com/rails-api/active_model_serializers/pull/843) Remove the mailing list from the README (@JoshSmith)
519
+ - [#842](https://github.com/rails-api/active_model_serializers/pull/842) Add notes on how you can help to contributing documentation (@JoshSmith)
520
+ - [#833](https://github.com/rails-api/active_model_serializers/pull/833) Cache serializers for class (@lsylvester)
521
+ - [#837](https://github.com/rails-api/active_model_serializers/pull/837) Store options in array serializers (@kurko)
522
+ - [#836](https://github.com/rails-api/active_model_serializers/pull/836) Makes passed in options accessible inside serializers (@kurko)
523
+ - [#773](https://github.com/rails-api/active_model_serializers/pull/773) Make json api adapter 'include' option accept an array (@sweatypitts)
524
+ - [#830](https://github.com/rails-api/active_model_serializers/pull/830) Add contributing readme (@JoshSmith)
525
+ - [#811](https://github.com/rails-api/active_model_serializers/pull/811) Reimplement serialization scope and scope_name (@mateomurphy)
526
+ - [#725](https://github.com/rails-api/active_model_serializers/pull/725) Support has_one to be compatible with 0.8.x (@ggordon)
527
+ * adds `has_one` attribute for backwards compatibility
528
+ - [#822](https://github.com/rails-api/active_model_serializers/pull/822) Replace has_one with attribute in template (@bf4)
529
+ - [#821](https://github.com/rails-api/active_model_serializers/pull/821) Fix explicit serializer for associations (@wjordan)
530
+ - [#798](https://github.com/rails-api/active_model_serializers/pull/798) Fix lost test `test_include_multiple_posts_and_linked` (@donbobka)
531
+ - [#807](https://github.com/rails-api/active_model_serializers/pull/807) Add Overriding attribute methods section to README. (@alexstophel)
532
+ - [#693](https://github.com/rails-api/active_model_serializers/pull/693) Cache Support at AMS 0.10.0 (@joaomdmoura)
533
+ * adds cache support to attributes and associations.
534
+ - [#792](https://github.com/rails-api/active_model_serializers/pull/792) Association overrides (@kurko)
535
+ * adds method to override association
536
+ - [#794](https://github.com/rails-api/active_model_serializers/pull/794) add to_param for correct URL generation (@carlesjove)
537
+
538
+ ### v0.10.0-pre
539
+
540
+ - [Introduce Adapter](https://github.com/rails-api/active_model_serializers/commit/f00fe5595ddf741dc26127ed8fe81adad833ead5)
541
+ - Prefer `ActiveModel::Serializer` to `ActiveModelSerializers`:
542
+ - [Namespace](https://github.com/rails-api/active_model_serializers/commit/729a823868e8c7ac86c653fcc7100ee511e08cb6#diff-fe7aa2941c19a41ccea6e52940d84016).
543
+ - [README](https://github.com/rails-api/active_model_serializers/commit/4a2d9853ba7486acc1747752982aa5650e7fd6e9).
544
+
545
+ ## 0.09.x
546
+
547
+ ### v0.9.3 (2015/01/21 20:29 +00:00)
548
+
549
+ Features:
550
+ - [#774](https://github.com/rails-api/active_model_serializers/pull/774) Fix nested include attributes (@nhocki)
551
+ - [#771](https://github.com/rails-api/active_model_serializers/pull/771) Make linked resource type names consistent with root names (@sweatypitts)
552
+ - [#696](https://github.com/rails-api/active_model_serializers/pull/696) Explicitly set serializer for associations (@ggordon)
553
+ - [#700](https://github.com/rails-api/active_model_serializers/pull/700) sparse fieldsets (@arenoir)
554
+ - [#768](https://github.com/rails-api/active_model_serializers/pull/768) Adds support for `meta` and `meta_key` attribute (@kurko)
555
+
556
+ ### v0.9.1 (2014/12/04 11:54 +00:00)
557
+ - [#707](https://github.com/rails-api/active_model_serializers/pull/707) A Friendly Note on Which AMS Version to Use (@jherdman)
558
+ - [#730](https://github.com/rails-api/active_model_serializers/pull/730) Fixes nested has_many links in JSONAPI (@kurko)
559
+ - [#718](https://github.com/rails-api/active_model_serializers/pull/718) Allow overriding the adapter with render option (@ggordon)
560
+ - [#720](https://github.com/rails-api/active_model_serializers/pull/720) Rename attribute with :key (0.8.x compatibility) (@ggordon)
561
+ - [#728](https://github.com/rails-api/active_model_serializers/pull/728) Use type as key for linked resources (@kurko)
562
+ - [#729](https://github.com/rails-api/active_model_serializers/pull/729) Use the new beta build env on Travis (@joshk)
563
+ - [#703](https://github.com/rails-api/active_model_serializers/pull/703) Support serializer and each_serializer options in renderer (@ggordon, @mieko)
564
+ - [#727](https://github.com/rails-api/active_model_serializers/pull/727) Includes links inside of linked resources (@kurko)
565
+ - [#726](https://github.com/rails-api/active_model_serializers/pull/726) Bugfix: include nested has_many associations (@kurko)
566
+ - [#722](https://github.com/rails-api/active_model_serializers/pull/722) Fix infinite recursion (@ggordon)
567
+ - [#1](https://github.com/rails-api/active_model_serializers/pull/1) Allow for the implicit use of ArraySerializer when :each_serializer is specified (@mieko)
568
+ - [#692](https://github.com/rails-api/active_model_serializers/pull/692) Include 'linked' member for json-api collections (@ggordon)
569
+ - [#714](https://github.com/rails-api/active_model_serializers/pull/714) Define as_json instead of to_json (@guilleiguaran)
570
+ - [#710](https://github.com/rails-api/active_model_serializers/pull/710) JSON-API: Don't include linked section if associations are empty (@guilleiguaran)
571
+ - [#711](https://github.com/rails-api/active_model_serializers/pull/711) Fixes rbx gems bundling on TravisCI (@kurko)
572
+ - [#709](https://github.com/rails-api/active_model_serializers/pull/709) Add type key when association name is different than object type (@guilleiguaran)
573
+ - [#708](https://github.com/rails-api/active_model_serializers/pull/708) Handle correctly null associations (@guilleiguaran)
574
+ - [#691](https://github.com/rails-api/active_model_serializers/pull/691) Fix embed option for associations (@jacob-s-son)
575
+ - [#689](https://github.com/rails-api/active_model_serializers/pull/689) Fix support for custom root in JSON-API adapter (@guilleiguaran)
576
+ - [#685](https://github.com/rails-api/active_model_serializers/pull/685) Serialize ids as strings in JSON-API adapter (@guilleiguaran)
577
+ - [#684](https://github.com/rails-api/active_model_serializers/pull/684) Refactor adapters to implement support for array serialization (@guilleiguaran)
578
+ - [#682](https://github.com/rails-api/active_model_serializers/pull/682) Include root by default in JSON-API serializers (@guilleiguaran)
579
+ - [#625](https://github.com/rails-api/active_model_serializers/pull/625) Add DSL for urls (@JordanFaust)
580
+ - [#677](https://github.com/rails-api/active_model_serializers/pull/677) Add support for embed: :ids option for in associations (@guilleiguaran)
581
+ - [#681](https://github.com/rails-api/active_model_serializers/pull/681) Check superclasses for Serializers (@quainjn)
582
+ - [#680](https://github.com/rails-api/active_model_serializers/pull/680) Add support for root keys (@NullVoxPopuli)
583
+ - [#675](https://github.com/rails-api/active_model_serializers/pull/675) Support Rails 4.2.0 (@tricknotes)
584
+ - [#667](https://github.com/rails-api/active_model_serializers/pull/667) Require only activemodel instead of full rails (@guilleiguaran)
585
+ - [#653](https://github.com/rails-api/active_model_serializers/pull/653) Add "_test" suffix to JsonApi::HasManyTest filename. (@alexgenco)
586
+ - [#631](https://github.com/rails-api/active_model_serializers/pull/631) Update build badge URL (@craiglittle)
587
+
588
+ ### 0.9.0.alpha1 - January 7, 2014
589
+
590
+ ### 0.9.0.pre
591
+
592
+ * The following methods were removed
593
+ - Model#active\_model\_serializer
594
+ - Serializer#include!
595
+ - Serializer#include?
596
+ - Serializer#attr\_disabled=
597
+ - Serializer#cache
598
+ - Serializer#perform\_caching
599
+ - Serializer#schema (needs more discussion)
600
+ - Serializer#attribute
601
+ - Serializer#include\_#{name}? (filter method added)
602
+ - Serializer#attributes (took a hash)
603
+
604
+ * The following things were added
605
+ - Serializer#filter method
606
+ - CONFIG object
607
+
608
+ * Remove support for ruby 1.8 versions.
609
+
610
+ * Require rails >= 3.2.
611
+
612
+ * Serializers for associations are being looked up in a parent serializer's namespace first. Same with controllers' namespaces.
613
+
614
+ * Added a "prefix" option in case you want to use a different version of serializer.
615
+
616
+ * Serializers default namespace can be set in `default_serializer_options` and inherited by associations.
617
+
618
+ * [Beginning of rewrite: c65d387705ec534db171712671ba7fcda4f49f68](https://github.com/rails-api/active_model_serializers/commit/c65d387705ec534db171712671ba7fcda4f49f68)
619
+
620
+ ## 0.08.x
621
+
622
+ ### v0.8.3 (2014/12/10 14:45 +00:00)
623
+ - [#753](https://github.com/rails-api/active_model_serializers/pull/753) Test against Ruby 2.2 on Travis CI (@tricknotes)
624
+ - [#745](https://github.com/rails-api/active_model_serializers/pull/745) Missing a word (@jockee)
625
+
626
+ ### v0.8.2 (2014/09/01 21:00 +00:00)
627
+ - [#612](https://github.com/rails-api/active_model_serializers/pull/612) Feature/adapter (@bolshakov)
628
+ * adds adapters pattern
629
+ - [#615](https://github.com/rails-api/active_model_serializers/pull/615) Rails does not support const_defined? in development mode (@tpitale)
630
+ - [#613](https://github.com/rails-api/active_model_serializers/pull/613) README: typo fix on attributes (@spk)
631
+ - [#614](https://github.com/rails-api/active_model_serializers/pull/614) Fix rails 4.0.x build. (@arthurnn)
632
+ - [#610](https://github.com/rails-api/active_model_serializers/pull/610) ArraySerializer (@bolshakov)
633
+ - [#607](https://github.com/rails-api/active_model_serializers/pull/607) ruby syntax highlights (@zigomir)
634
+ - [#602](https://github.com/rails-api/active_model_serializers/pull/602) Add DSL for associations (@JordanFaust)
635
+
636
+ ### 0.8.1 (May 6, 2013)
637
+
638
+ * Fix bug whereby a serializer using 'options' would blow up.
639
+
640
+ ### 0.8.0 (May 5, 2013)
641
+
642
+ * Attributes can now have optional types.
643
+
644
+ * A new DefaultSerializer ensures that POROs behave the same way as ActiveModels.
645
+
646
+ * If you wish to override ActiveRecord::Base#to_Json, you can now require
647
+ 'active_record/serializer_override'. We don't recommend you do this, but
648
+ many users do, so we've left it optional.
649
+
650
+ * Fixed a bug where ActionController wouldn't always have MimeResponds.
651
+
652
+ * An optinal caching feature allows you to cache JSON & hashes that AMS uses.
653
+ Adding 'cached true' to your Serializers will turn on this cache.
654
+
655
+ * URL helpers used inside of Engines now work properly.
656
+
657
+ * Serializers now can filter attributes with `only` and `except`:
658
+
659
+ ```
660
+ UserSerializer.new(user, only: [:first_name, :last_name])
661
+ UserSerializer.new(user, except: :first_name)
662
+ ```
663
+
664
+ * Basic Mongoid support. We now include our mixins in the right place.
665
+
666
+ * On Ruby 1.8, we now generate an `id` method that properly serializes `id`
667
+ columns. See issue #127 for more.
668
+
669
+ * Add an alias for `scope` method to be the name of the context. By default
670
+ this is `current_user`. The name is automatically set when using
671
+ `serialization_scope` in the controller.
672
+
673
+ * Pass through serialization options (such as `:include`) when a model
674
+ has no serializer defined.
675
+
676
+ ## [0.7.0 (March 6, 2013)](https://github.com/rails-api/active_model_serializers/commit/fabdc621ff97fbeca317f6301973dd4564b9e695)
677
+
678
+ * ```embed_key``` option to allow embedding by attributes other than IDs
679
+ * Fix rendering nil with custom serializer
680
+ * Fix global ```self.root = false```
681
+ * Add support for specifying the serializer for an association as a String
682
+ * Able to specify keys on the attributes method
683
+ * Serializer Reloading via ActiveSupport::DescendantsTracker
684
+ * Reduce double map to once; Fixes datamapper eager loading.
685
+
686
+ ## 0.6.0 (October 22, 2012)
687
+
688
+ * Serialize sets properly
689
+ * Add root option to ArraySerializer
690
+ * Support polymorphic associations
691
+ * Support :each_serializer in ArraySerializer
692
+ * Add `scope` method to easily access the scope in the serializer
693
+ * Fix regression with Rails 3.2.6; add Rails 4 support
694
+ * Allow serialization_scope to be disabled with serialization_scope nil
695
+ * Array serializer should support pure ruby objects besides serializers
696
+
697
+ ## 0.05.x
698
+
699
+ ### [0.5.2 (June 5, 2012)](https://github.com/rails-api/active_model_serializers/commit/615afd125c260432d456dc8be845867cf87ea118#diff-0c5c12f311d3b54734fff06069efd2ac)
700
+
701
+ ### [0.5.1 (May 23, 2012)](https://github.com/rails-api/active_model_serializers/commit/00194ec0e41831802fcbf893a34c0bb0853ebe14#diff-0c5c12f311d3b54734fff06069efd2ac)
702
+
703
+ ### [0.5.0 (May 16, 2012)](https://github.com/rails-api/active_model_serializers/commit/33d4842dcd35c7167b0b33fc0abcf00fb2c92286)
704
+
705
+ * First tagged version
706
+ * Changes generators to always generate an ApplicationSerializer
707
+
708
+ ## [0.1.0 (December 21, 2011)](https://github.com/rails-api/active_model_serializers/commit/1e0c9ef93b96c640381575dcd30be07ac946818b)
709
+
710
+ ## First Commit as [Rails Serializers 0.0.1](https://github.com/rails-api/active_model_serializers/commit/d72b66d4c5355b0ff0a75a04895fcc4ea5b0c65e)
711
+ (December 1, 2011).
712
+
713
+ ## Prehistory
714
+
715
+ - [Changing Serialization/Serializers namespace to `Serializable` (November 30, 2011)](https://github.com/rails/rails/commit/8896b4fdc8a543157cdf4dfc378607ebf6c10ab0)
716
+ - [Merge branch 'serializers'. This implements the ActiveModel::Serializer object. Includes code, tests, generators and guides. From José and Yehuda with love.](https://github.com/rails/rails/commit/fcacc6986ab60f1fb2e423a73bf47c7abd7b191d)
717
+ - But [was reverted](https://github.com/rails/rails/commit/5b2eb64ceb08cd005dc06b721935de5853971473).
718
+ '[Revert the serializers API as other alternatives are now also under discussion](https://github.com/rails/rails/commit/0a4035b12a6c59253cb60f9e3456513c6a6a9d33)'.
719
+ - [Proposed Implementation to Rails 3.2 by @wycats and @josevalim (November 25, 2011)](https://github.com/rails/rails/pull/3753)
720
+ - [Creation of `ActionController::Serialization`, initial serializer
721
+ support (September, 26 2011)](https://github.com/rails/rails/commit/8ff7693a8dc61f43fc4eaf72ed24d3b8699191fe).
722
+ - [Docs and CHANGELOG](https://github.com/rails/rails/commit/696d01f7f4a8ed787924a41cce6df836cd73c46f)
723
+ - [Deprecation of ActiveModel::Serialization to ActiveModel::Serializable](https://github.com/rails/rails/blob/696d01f7f4a8ed787924a41cce6df836cd73c46f/activemodel/lib/active_model/serialization.rb)
724
+ - [Creation of `ActiveModel::Serialization` from `ActiveModel::Serializer` in Rails (2009)](https://github.com/rails/rails/commit/c6bc8e662614be711f45a8d4b231d5f993b024a7#diff-d029b9768d8df0407a35804a468e3ae5)
725
+ - [Integration of `ActiveModel::Serializer` into `ActiveRecord::Serialization`](https://github.com/rails/rails/commit/783db25e0c640c1588732967a87d65c10fddc08e)
726
+ - [Creation of `ActiveModel::Serializer` in Rails (2009)](https://github.com/rails/rails/commit/d2b78b3594b9cc9870e6a6ebfeb2e56d00e6ddb8#diff-80d5beeced9bdc24ca2b04a201543bdd)
727
+ - [Creation of `ActiveModel::Serializers::JSON` in Rails (2009)](https://github.com/rails/rails/commit/fbdf706fffbfb17731a1f459203d242414ef5086)