#220 ✓resolved
iamjwc (at gmail)

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

Reported by iamjwc (at gmail) | 2008-05-16 03:56:56 UTC

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

Comments and changes to this ticket

  • Mislav

    Mislav 2008-05-16 12:21:36 UTC

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

  • Mislav

    Mislav 2008-06-03 15:05:20 UTC

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

    Report back the result

  • Deleted User

    Deleted User 2008-06-03 21:02:44 UTC

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

  • Vince Wadhwani

    Vince Wadhwani 2008-06-06 02:24:05 UTC

    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!

  • Mislav

    Mislav 2008-06-06 11:10:08 UTC

    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:

  • Vince Wadhwani

    Vince Wadhwani 2008-06-06 19:18:21 UTC

    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

  • Mislav

    Mislav 2008-06-11 14:13:14 UTC

    • State changed from “open” to “resolved”
  • FotoVerite

    FotoVerite 2008-09-20 09:48:06 UTC

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

  • Mislav

    Mislav 2008-09-21 14:32:17 UTC

    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.

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

New ticket Create new ticket

Create your profile

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

Everyone's favorite Ruby library for pagination of practically anything!

Referenced by

Pages