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.

This project is archived and is in readonly mode.

ActiveRecord::Reflection cannot be compared with nil

#842

ActiveRecord::Reflection instances currently throw an exception if compared with nil. I added a simple nil check to the == method.

Reported by Bob Aman · August 15th, 2008 @ 08:51 PM

State: resolved
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Ryan Bates
    Ryan Bates

    It's probably best to fix this for other objects as well.

    
    reflection == Object.new # raises an error
    

    Attached is a patch which ensures the object is a reflection before comparing.

    August 15th, 2008 @ 09:53 PM

  2. Bob Aman
  3. Pratik
    Pratik
    • Title changed from PATCH: ActiveRecord::Reflection cannot be compared with nil to ActiveRecord::Reflection cannot be compared with nil

    August 16th, 2008 @ 08:21 PM

  4. Repository
    Repository
    • State changed from new to resolved

    (from [8f4d3957a6986fe450cfd9058bb92ae1d6e5e745]) Don't raise exception when comparing ActiveRecord::Reflection. [#842 ActiveRecord::Reflection cannot be compared with nil state:resolved]

    Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...

    August 16th, 2008 @ 08:39 PM