module Pagy::Backend

def pagy_get_vars(collection, vars)

You may need to override the count call for non AR collections
Sub-method called only by #pagy: here for easy customization of variables by overriding
def pagy_get_vars(collection, vars)
  pagy_set_items_from_params(vars) if defined?(ItemsExtra)
  vars[:count] ||= (count = collection.count(:all)).is_a?(Hash) ? count.size : count
  vars[:page]  ||= params[vars[:page_param] || DEFAULT[:page_param]]
  vars
end