Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

WillPaginate::Finder::ClassMethods::paginate not being discovered #23

Closed
mickeyren opened this Issue · 6 comments

2 participants

@mickeyren

I posted this on the railsforum too before I discovered this - but it seems the function paginate is not being recognized - but the rest are (eg, paginate_by_sql). To remedy the issue i did 2 things:

I had to put this extra line in lib/will_paginate.rb

ActiveRecord::Base.extend(WillPaginate::Finder::ClassMethods) or else the additional class methods won't be found.

Next, i change the function name "paginate" to "paginate_result" and that seemed to do the trick.

Perhaps a name clash or something, I would be happy to discover the root of this problem and a possible solution if someone can give suggestions.

@mislav
Owner

What version of will_paginate, what version of Rails, how are you loading the will_paginate library, what plugins do you have installed?

@mickeyren

actually i tried everything - as a plugin, gem install via both git and gemcutter. All latest one - 2.3.11.

@mislav
Owner

will_paginate hooks into ActiveRecord like you see here: http://github.com/mislav/will_paginate/blob/master/lib/will_paginate.rb#L87-90

it bails out if it sees that AR::Base already has a paginate method. Maybe you have some plugin that adds a paginate method?

@mickeyren

that's what i suspect, is there any way to trace this ?

@mislav
Owner

Simple. Either paste the list of plugins/gems you use, or don't load will_paginate at all and open script/console to check if ActiveRecord::Base.respond_to? :paginate is true.

@mislav
Owner

Closing; hope this was resolved

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.