1
0
Fork 0
mirror of https://github.com/kaminari/kaminari.git synced 2022-11-09 13:44:37 -05:00
kaminari--kaminari/lib/kaminari/models/mongoid_criteria_methods.rb

23 lines
395 B
Ruby

module Kaminari
module MongoidCriteriaMethods
def limit_value #:nodoc:
options[:limit]
end
def offset_value #:nodoc:
options[:skip]
end
def total_count #:nodoc:
embedded? ? unpage.count : count
end
private
def unpage
clone.tap do |crit|
crit.options.delete :limit
crit.options.delete :skip
end
end
end
end