diff options
author | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-09-21 16:49:33 -0500 |
---|---|---|
committer | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-09-21 16:49:33 -0500 |
commit | 3395ebe32097f6c711a3f3f1f44b67b3f969107e (patch) | |
tree | 5476b05e6ff8aebbdd2bd270717a83f3ac1f5aca /guides | |
parent | 68bd4db190fea5aad213886898e3d541f8de6fa5 (diff) | |
download | rails-3395ebe32097f6c711a3f3f1f44b67b3f969107e.tar.gz rails-3395ebe32097f6c711a3f3f1f44b67b3f969107e.tar.bz2 rails-3395ebe32097f6c711a3f3f1f44b67b3f969107e.zip |
add note about AR#include_root_in_json default in Upgrading Rails guide [ci skip]
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/upgrading_ruby_on_rails.md | 16 |
1 files changed, 15 insertions, 1 deletions
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 |