Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Jonathan Julian's latest activity

Thursday, November 18 2010
5801 ActiveRecord::Base#exists? raises exception when using :include in default_scope was updated in Ruby on Rails
  • Jonathan Julian
    Jonathan Julian commented at 4:35 AM

    This also raises when exists? is called on an association with an :include. Note that it only raises when it should return true. ActiveRecord 3.0.2

    A workaround...

Wednesday, June 30 2010
3087 ActiveSupport::JSON.encode is Inconsistent for #as_json and #to_json was updated in Ruby on Rails
  • Jonathan Julian
    Jonathan Julian commented at 6:50 PM

    Ack! Don't close this!

    Remember that the caller can get a hash representation by invoking as_json by hand, passing the options hash. This ticket describes the p...

  • Jonathan Julian
    Jonathan Julian commented at 6:01 PM

    @Neeraj: Try this: remove the as_json definition from your AR class, and change your controller to do:

    format.json  { render :json => @users.as_json(:only => [...
Tuesday, May 18 2010
3087 ActiveSupport::JSON.encode is Inconsistent for #as_json and #to_json was updated in Ruby on Rails
  • Jonathan Julian
    Jonathan Julian commented at 2:45 PM

    I think ActiveSupport 2.3.x needs to provide an as_json implementation that calls as_json(options) on each array element. This is not limited to ActiveRecord.

    ...
Sunday, April 04 2010
3087 ActiveSupport::JSON.encode is Inconsistent for #as_json and #to_json was updated in Ruby on Rails
  • Jonathan Julian
    Jonathan Julian commented at 4:45 PM

    Another way to describe this: as_json options are not passed down to each element of an array of ActiveRecord objects. In the first example, all the attributes ...