mirror of
https://github.com/kaminari/kaminari.git
synced 2022-11-09 13:44:37 -05:00
23 lines
395 B
Ruby
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
|