ryanb/xapit

Xapit::Collection#offset

Opened this issue · 3 comments

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

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?

adding Collection#offset for will_paginate compatibility - closed by 8fd2a2e

Right now Xapit just does multiple find queries for convenience. I plan to merge this into a single query in the near future.