I'm implementing a search function by using acts_as_indexed along with will_paginate. I'm using Ruby 1.8.7 and Rails 2.3.11. No, I cannot upgrade Ruby as I'm using a shared host.
Regular use of the 'paginate' method yields expected results, however when using 'paginate_search' (acts_as_indexed pagination method), I get weird results:
-The wines are all retrieved from the database (I looked at the log and the query looks good)
-It's the pagination that screws up, yielding inconsistent 'per-page' results
Assuming a search result of 3 objects:
Set per-page to 1, get 18 pages all without results except for pages 4, 12 and 18
Set per-page to 2, get 9 pages all without results except for pages 2, 6 and 9 (see a pattern here?)
Set per-page to 3, get 6 pages all without results except for pages 2, 4 and 6
- All of the above patterns yield 1 result per result page
So on and so forth...it seems there's some funky math going on but I don't know where or why.