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 through reflections has recursion bug

#3764

In 2.3-stable, rails/activerecord/lib/active_record/reflection.rb:309 (source_reflection) calls klass.

klass in turn calls derive_class_name, which - if options[:source_type] falls through - calls… source_reflection. And boom, stack blows.

Don't know how to fix, as I only just found the bug.

This came up for me when using something like:

ThroughManyHaver.last :include => :through_relation

Reported by Sai Emrys · January 21st, 2010 @ 09:08 AM

State: stale
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Rizwan Reza
    Rizwan Reza

    Can you provide a failing test for this?

    January 21st, 2010 @ 03:48 PM

  2. Sai Emrys
    Sai Emrys

    I don't know Rails' testing framework well enough to do so, sorry.

    But the error is fairly evident just from looking through the calls.

    January 24th, 2010 @ 01:01 AM

  3. Rohit Arondekar
    Rohit Arondekar
    • State changed from new to stale
    • Importance changed from to Low

    Marking ticket as stale. If this is still an issue please leave a comment with suggested changes, creating a patch with tests, rebasing an existing patch or just confirming the issue on a latest release or master/branches.

    October 8th, 2010 @ 03:08 AM