Hi there, I’m using the paginating_find plugin for one of my more
popular apps. I’ve gotten a few requests from users asking not to
break records associated with a given date across multiple pages.
Right now, I specify the size of a record set as part of the find i.e.
20 records (see below). That generally will allow for 2 or 3 days of
records, cutting the 4th day, as an example, across two pages.
I need that to be more flexible to return a minimum of 20 records, but
to grab all records for a given day if 20 records is going to cut any
day across multiple pages. Not sure how to structure that though?
Below is an example of the paginating find I’m currently using:
@diary = Entries.find(:all, :conditions => [“user_id = ? and
created_at LIKE ?”,@diary_owner.id, params[:date] + ‘%’], :page =>
{:size => 20, :current => params[:page], :first => 1}, :order =>
‘created_at desc’)
Has anyone else had to solve this same problem either with
paginating_find or without? I look forward to your suggestions.
Thanks!
-A