I tried upgrading my rails app from rails 4.1.0 => 4.2.7 but found that it broke my JSON views. In particular, ActiveRecord objects no longer render correctly.
Model.first.to_json in rails console now produces
"#\u003cModel:0x007f9208c904e0\u003e", rather than valid JSON as before.
Model.first.as_json works correctly, but for some reason, it seems
to_json is calling
I tried overriding the ActiveSupport encoder but it didn't help, and am pretty stumped.
(UPDATE: I also noticed
Time.now.utc.to_json changed from
2017-12-07 19:37:55 UTC, the latter being ==
time.as_json and the former ==