From 3395ebe32097f6c711a3f3f1f44b67b3f969107e Mon Sep 17 00:00:00 2001 From: Francesco Rodriguez Date: Fri, 21 Sep 2012 16:49:33 -0500 Subject: add note about AR#include_root_in_json default in Upgrading Rails guide [ci skip] --- guides/source/upgrading_ruby_on_rails.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/upgrading_ruby_on_rails.md b/guides/source/upgrading_ruby_on_rails.md index 1eb8ff2f59..d6c425a356 100644 --- a/guides/source/upgrading_ruby_on_rails.md +++ b/guides/source/upgrading_ruby_on_rails.md @@ -51,7 +51,21 @@ Rails 4.0 has changed `serialized_attributes` and `attr_readonly` to class metho ### Active Model -Rails 4.0 has changed how errors attach with the `ActiveModel::Validations::ConfirmationValidator`. Now when confirmation validations fail the error will be attached to `:#{attribute}_confirmation` instead of `attribute`. +Rails 4.0 has changed how errors attach with the `ActiveModel::Validations::ConfirmationValidator`. +Now when confirmation validations fail the error will be attached to +`:#{attribute}_confirmation` instead of `attribute`. + +Rails 4.0 has changed `ActiveModel::Serializers::JSON.include_root_in_json` default +value to `false`. Now, Active Model Serializers and Active Record objects have the +same default behaviour. This means that you can comment or remove the following option +in the `config/initializers/wrap_parameters.rb` file: + +```ruby +# Disable root element in JSON by default. +# ActiveSupport.on_load(:active_record) do +# self.include_root_in_json = false +# end +``` ### Action Pack -- cgit v1.2.3