Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Upgrading from will_paginate 3.0.pre2 to 3.0.1/2 #219

Closed
johnkelly opened this Issue Jan 9, 2012 · 1 comment

Comments

Projects
None yet
2 participants

I'm trying to upgrade the will_paginate gem to the latest version to remove the warning message that appears when running rake in rails 3.1. After upgrading the gem, I'm getting several spec failures and I can't understand what is causing them to work in will_paginate 3.0.pre2 but not in 3.0.1 or 3.0.2.

The environment is in Ruby 1.8.7EE and Rails 3.1.3

Spec Failure Examples:

1)
Message: undefined method "paginate" for #<Array:0x10f45b298>
Code: ```teachers.uniq.paginate :page => params[:page], :order => "lower(last_name) ASC"```
Where teachers is an array

2)
Message: undefined method "paginate" for #<Array:0x10f45b298>
Code: ``` Program.all.sort_by { |p| p.full_title }.paginate :page => params[:page]```

3)
Message: undefined method "paginate" for #<Array:0x10f45b298>
Code: ```Staffer.students(params[:search][:teacher_email], @subscriber).paginate :page => params[:page]```
Owner

mislav commented Jan 10, 2012

It's documented on the wiki

Static arrays aren't paginateable by default. You have to require "will_paginate/array" to be able to paginate static arrays. You can do so in your test helper file.

@mislav mislav closed this Jan 10, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment