Xapit::Collection#offset
Opened this issue · 3 comments
Deleted user commented
The addition of Xapit::Collection#offset would allow the use of will_paginates' page_entries_info helper method.
def offset
(current_page - 1) * per_page
end
Deleted user commented
On second thought, is it recommended to perform a search and then pass the ids to ActiveRecord::Base#find? I also noticed iterating over Xapit::Collection will perform a query for each record, which is why I wonder if this is a design decision so that Xapit remains decoupled from ActiveRecord?
ryanb commented
Right now Xapit just does multiple find
queries for convenience. I plan to merge this into a single query in the near future.