Rails 2.3-stable killed to_json

I bumped Rails 2.3-stable branch in our app today and deployed, thinking I’m being a good developer by getting all the bugfixes this way.

What I actually did is broke many aspects of our app because all to_json calls now return “{}” (hardcoded).

Both ways to solve this require changing my code:

  1. follow the instructions in the commit; or
  2. change all to_json calls to rails_to_json.

Now, I’ve been following the talk about ActiveSupport incompatibility with the JSON gem. I’m not interesting in raising those issues again. I want to know why was such thing backported — without warning — breaking backwards compatibility?

to_json should still work as expected -- this is a bug.

jeremy

I think this was fixed in a commit a few days ago.

I think this was fixed in a commit a few days ago.

Looks that way to me too. Mislav, are we correct?

I want to do a point release from 2-3-stable relatively soon (honest). So I'm keen to hear if this is fixed.

I can confirm it is fixed. I was unlucky enough to fetch the 2.3-stable branch right before that update got in. The very next commit was the fix.

Thanks :slight_smile:

The to_json() output in 2-3-stable was only partially fixed by #2690. There are still backwards compatibility issues with 2.3.2.1. I have created a ticket that illustrates the issue: https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2753-to_json-behavior-still-different-between-rails-2321-and-rails-2-3-stable