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.

John Firebaugh's latest activity

Thursday, April 07 2011
4520 #as_json should only ever return a Hash, Array, Numeric, String, nil, true or... was updated in Ruby on Rails
  • John Firebaugh
    John Firebaugh commented at 8:44 PM

    Another issue: TrueClass, FalseClass, and NilClass return an ActiveSupport::JSON::Variable from #as_json. Instead, they should return self and override encode_j...

Wednesday, April 06 2011
4520 #as_json should only ever return a Hash, Array, Numeric, String, nil, true or... was updated in Ruby on Rails
  • John Firebaugh
    • State changed from stale to open
    by John Firebaugh at 10:13 PM

    I agree. It would be very useful to have the following invariant:

    ∀o, o.as_json == JSON.parse(o.to_json)

    The principal violator is ActiveModel::Serializers::JSO...

Friday, April 01 2011
5885 as_json does not get called when using the include param in the to_json metho... was updated in Ruby on Rails
Monday, March 21 2011
6544 AS::JSON Yaml backend sometimes do not honor AS:parse_json_times was updated in Ruby on Rails
  • John Firebaugh
    John Firebaugh commented at 11:44 PM

    +1, I encountered this in 3.0.5 as well.

Tuesday, February 22 2011
5400 ActiveRecord::Serialization.serializable_hash uses base :only/:expect for inc... was updated in Ruby on Rails
  • John Firebaugh
    John Firebaugh commented at 7:20 AM

    +1

    Existing behavior is quite surprising.

Thursday, December 23 2010
2873 Application reloading should be deferred to end of request, currently interfe... was updated in Ruby on Rails
Thursday, December 09 2010
6077 ActiveSupport::JSON.encode fails for Struct types was updated in Ruby on Rails
  • John Firebaugh
    John Firebaugh commented at 12:58 AM

    A custom #as_json definition should usually call Array#as_json or Hash#as_json itself. For example, the correct definition in the example above is:

    class Base
    ...
Tuesday, November 30 2010
4554 render :text => proc { ... } regression was updated in Ruby on Rails
  • John Firebaugh
    John Firebaugh commented at 9:41 PM

    As Martin alludes to, the proc assigned to response_body is mistakenly executed twice. This is because ActionDispatch::Response overrides #body (defined in Rack...