has many :through causes "Stack level too deep error"
Reported by iamjwc (at gmail) | May 16th, 2008 @ 03:50 AM
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 May 16th, 2008 @ 12:21 PM
- → 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 June 3rd, 2008 @ 03:05 PM
Please try with Rails 2.1 final and "mislav-will_paginate" gem from http://gems.github.com
Report back the result
-
Glenn Gentzke June 3rd, 2008 @ 09:02 PM
Hey Mislav, i tested this out and it worked just peachy. I blogged about it here.
-
Vince Wadhwani June 6th, 2008 @ 02:24 AM
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 June 6th, 2008 @ 11:10 AM
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 June 6th, 2008 @ 07:18 PM
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 June 11th, 2008 @ 02:13 PM
- → State changed from open to resolved
-

FotoVerite September 20th, 2008 @ 09:48 AM
- → Tag changed from 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.
-
-

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