This project is archived and is in readonly mode.

#3764 ✓stale
Sai Emrys

ActiveRecord through reflections has recursion bug

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

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

Comments and changes to this ticket

  • Rizwan Reza

    Rizwan Reza January 21st, 2010 @ 03:48 PM

    Can you provide a failing test for this?

  • Sai Emrys

    Sai Emrys January 24th, 2010 @ 01:01 AM

    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.

  • Rohit Arondekar

    Rohit Arondekar October 8th, 2010 @ 03:08 AM

    • 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.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages