Rails 2.3-stable killed to_json

6 views
Skip to first unread message

Mislav Marohnić

unread,
May 28, 2009, 5:13:38 AM5/28/09
to Rails core
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?

Jeremy Kemper

unread,
May 28, 2009, 12:20:46 PM5/28/09
to rubyonra...@googlegroups.com
> know why was such thing backported -- without warning -- breaking backwards
> compatibility?

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

jeremy

Hongli Lai

unread,
May 29, 2009, 5:51:19 AM5/29/09
to Ruby on Rails: Core
On May 28, 11:13 am, Mislav Marohnić <mislav.maroh...@gmail.com>
wrote:
> 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<http://github.com/rails/rails/commit/d052e9fb5868a10df33a84bf61f40a32...>;
>    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?

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

Michael Koziarski

unread,
May 31, 2009, 7:48:17 PM5/31/09
to rubyonra...@googlegroups.com
> 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.


--
Cheers

Koz

Mislav Marohnić

unread,
Jun 1, 2009, 6:08:37 AM6/1/09
to rubyonra...@googlegroups.com
On Mon, Jun 1, 2009 at 01:48, Michael Koziarski <mic...@koziarski.com> wrote:

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

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

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 :)

Cody Fauser

unread,
Jun 3, 2009, 11:20:38 AM6/3/09
to rubyonra...@googlegroups.com
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
--
Cody Fauser
http://shopify.com - e-commerce done right
http://www.codyfauser.com - blog
http://peepcode.com/products/activemerchant-pdf - ActiveMerchant PeepCode
http://www.oreilly.com/catalog/rjsrails - RJS Templates for Rails
Reply all
Reply to author
Forward
0 new messages