This project is archived and is in readonly mode.
[PATCH] Fix changing ActiveModel include_root_in_json = true to default
-
Christopher Redinger
This patch did not apply cleanly to the current master. Submitting an updated patch that does.
-
Neeraj Singh
@Christopher Looks like you have some end of line settings that is marking all the test lines as changed.
- assert_match %r{^\{"contact":\{}, json - assert_match %r{"name":"Konata Izumi"}, json - assert_match %r{"age":16}, json - assert json.include?(%("created_at":#{ActiveSupport::JSON.encode(Time.utc(2006, 8, 1))})) - assert_match %r{"awesome":true}, json - assert_match %r{"preferences":\{"shows":"anime"\}}, json - ensure - Contact.include_root_in_json = false - end + json = @contact.to_json + + assert_match %r{^\{"contact":\{}, json + assert_match %r{"name":"Konata Izumi"}, json + assert_match %r{"age":16}, json + assert json.include?(%("created_at":#{ActiveSupport::JSON.encode(Time.utc(2006, 8, 1))})) + assert_match %r{"awesome":true}, json + assert_match %r{"preferences":\{"shows":"anime"\}}, jsonAlso in json_serialization_test.rb has two tests with Contact.include_root_in_json = true . Can you add one test with Contact.include_root_in_json = false just to make sure that without root things work fine.
-
Christopher Redinger
Neeraj - nope, those are valid changes. They were wrapped in an unnecessary begin/ensure block. I removed the block, and thus outdented the lines.
-
Neeraj Singh
@Christopher my bad. Thanks for the update.
-
Rizwan Reza
- Milestone cleared.
- Tag changed from serialization active_model json include_root_in_json to activemodel, bugmash, json, serialization
-
Michael Koziarski
- Milestone cleared.
-
Santiago Pastorino
- State changed from new to open
- Assigned user set to Santiago Pastorino
-
Repository
- State changed from open to resolved
(from [a04060fb6fe006b1dbc224263dd6c39525733c6d]) Really make include_root_in_json default to true [#3770 state:resolved] http://github.com/rails/rails/commit/a04060fb6fe006b1dbc224263dd6c3...
