提交 8c7d4018 编写于 作者: Y Yves Senn

`ActiveRecord::Base.include_root_in_json` is `false` by default.

Closes #9459.

The PR #6597 unified the configuration for `include_root_in_json`
in AM and AR to `false`.
Later on with the refactoring commit: e030f26a the value in AR was
set to `true` but I think this was not on purpose.

With this commit both AM and AR will have the same configuration
for `include_root_in_json`, which is `false`.
上级 eeba6794
......@@ -5,7 +5,7 @@ module Serialization
include ActiveModel::Serializers::JSON
included do
self.include_root_in_json = true
self.include_root_in_json = false
end
def serializable_hash(options = nil)
......
......@@ -18,6 +18,10 @@ def setup
}
end
def test_include_root_in_json_is_false_by_default
assert_equal false, ActiveRecord::Base.include_root_in_json, "include_root_in_json should be false by default but was not"
end
def test_serialize_should_be_reversible
FORMATS.each do |format|
@serialized = Contact.new.send("to_#{format}")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册