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.

has many :through causes "Stack level too deep error"

#220
class Program < AR::Base
  has_many :sessions, :through => :components
end

Program.find(:first).sessions # => [#<Session:...>, #<Session:...>]

Program.find(:first).sessions.first # throws SystemStackError "stack level too deep"

Stack Trace

RAILS_ROOT/vendor/plugins/will_paginate/lib/will_paginate/finder.rb:92:in `method_missing_without_paginate'

RAILS_ROOT/vendor/plugins/will_paginate/lib/will_paginate/finder.rb:93:in `method_missing'

Notes

Using Rails 2.1 RC 1

Reported by iamjwc (at gmail) · May 16th, 2008 @ 03:56 AM

State: resolved
Milestone: none
Assigned to: Mislav Mislav

Activity

  1. Mislav
    Mislav
    • State changed from new to open
    • Assigned user changed from Chris Wanstrath to Mislav

    Thanks for the short and complete bug report. This looks serious, I'm going to investigate. First thing I'll try to do is a failing test based on your setup.

    May 16th, 2008 @ 12:21 PM

  2. Mislav
    Mislav

    Please try with Rails 2.1 final and "mislav-will_paginate" gem from http://gems.github.com

    Report back the result

    June 3rd, 2008 @ 03:05 PM

  3. Deleted User
    Deleted User

    Hey Mislav, i tested this out and it worked just peachy. I blogged about it here.

    June 3rd, 2008 @ 09:02 PM

  4. Vince Wadhwani
    Vince Wadhwani

    I unpacked the gem and manually copied over the contents into my projects vendor/plugin.. probably not the best way to do it but it does work for me now (Ruby 1.8.7 Rails 2.1 final on Debian) Thanks!

    June 6th, 2008 @ 02:24 AM

  5. Mislav
    Mislav

    Hey Vince,

    You could have just done this:

    script/plugin install git://github.com/mislav/will_paginate.git

    But why did you have to do it? Latest "mislav-will_paginate" gem works fine

    with Rails 2.1.

    On Fri, Jun 6, 2008 at 2:24 AM, Lighthouse

    wrote:

    June 6th, 2008 @ 11:10 AM

  6. Vince Wadhwani
    Vince Wadhwani

    Hi Mislav,

    Bah, I think I may have accidentally uninstalled the gem which would explain the errors I got and why I unpacked/copied. Sorry.. in any case, thanks for the link to the plugin!

    -Vince

    June 6th, 2008 @ 07:18 PM

  7. Mislav
    Mislav
    • State changed from open to resolved

    June 11th, 2008 @ 02:13 PM

  8. FotoVerite
    FotoVerite
    • Tag set to edge, gem, will_paginate

    Found the error was using the validation

    validates_associated :image_gallery, :on => :create

    will send full code if you think it will track down why this is happening.

    September 20th, 2008 @ 09:48 AM

  9. Mislav
    Mislav

    Hey,

    Please make comments on #223.

    If you could recreate the error in a blank Rails application with latest will_paginate, that would be very helpful. Zip the contents of the "app/" directory and upload it to #223.

    September 21st, 2008 @ 02:32 PM

  10. Roger

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.