#233 ✓resolved
Elliot Larson

Stack Level Too Deep Issue

Reported by Elliot Larson | June 28th, 2008 @ 05:58 AM

I'm using Rails 2.1 and and will_paginate 2.3.2. I have the following models:

class Product < ActiveRecord::Base

has_many :product_audience_associations

has_many :audiences, :class_name => "ProductAudience", :through => :product_audience_associations

end

class ProductAudience < ActiveRecord::Base

has_many :product_audience_associations

has_many :products, :through => :product_audience_associations

end

class ProductAudienceAssociation < ActiveRecord::Base

belongs_to :product

belongs_to :audience, :class_name => "ProductAudience", :foreign_key => :product_audience_id

end

When I go to save a product record, I get the following error trace with the error message "stack level too deep":

/Library/WebServer/Websites/Thoratec/rails_thoratec_2/vendor/plugins/will_paginate/lib/will_paginate/finder.rb:164 :in `method_missing_without_paginate'

/Library/WebServer/Websites/Thoratec/rails_thoratec_2/vendor/plugins/will_paginate/lib/will_paginate/finder.rb:164 :in `method_missing'

/Library/Ruby/Gems/1.8/gems/activerecord-2.1.0/lib/active_record/associations.rb:1180 :in `validate_associated_records_for_audiences'

/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:173 :in `send'

/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:173 :in `evaluate_method'

/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:161 :in `call'

/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:90 :in `run'

/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:90 :in `each'

/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:90 :in `send'

/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:90 :in `run'

/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:272 :in `run_callbacks'

/Library/Ruby/Gems/1.8/gems/activerecord-2.1.0/lib/active_record/validations.rb:929 :in `valid_without_callbacks?'

/Library/Ruby/Gems/1.8/gems/activerecord-2.1.0/lib/active_record/callbacks.rb:267 :in `valid?'

If I remove will_paginate, things work out... but, then I don't get to paginate with will_paginate, which makes me sad.

Comments and changes to this ticket

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!

Pages