Module: MongoModel::Scope::Pagination

Included in:
MongoModel::Scope
Defined in:
lib/mongomodel/support/scope/pagination.rb

Instance Method Summary collapse

Instance Method Details

#paginate(options = {}) ⇒ Object



4
5
6
7
8
9
# File 'lib/mongomodel/support/scope/pagination.rb', line 4

def paginate(options={})
  page     = options[:page] || 1
  per_page = options[:per_page] || klass.per_page

  Paginator.new(self, page, per_page)
end