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/data_mapper_collection_methods.rb
Akira Matsuda 3e7e4eb15a Revert "Drop DataMapper support"
This reverts commit 699ddc934b.

We decided not to immediately drop these adapters support.
We'll deprecate them in 0.17.0, then remove them from core in 1.0.
2016-04-14 16:18:42 +09:00

19 lines
375 B
Ruby

module Kaminari
module DataMapperCollectionMethods
def entry_name
model.model_name.human.downcase
end
def limit_value #:nodoc:
query.options[:limit] || 0
end
def offset_value #:nodoc:
query.options[:offset] || 0
end
def total_count #:nodoc:
model.count(query.options.except(:limit, :offset, :order))
end
end
end