Sha256: dd564fc22e812e1c4e4abdf54da1908a083d5ae682203d29f1872e4c02d5507a

Contents?: true

Size: 486 Bytes

Versions: 24

Compression:

Stored size: 486 Bytes

Contents

require 'kaminari/models/plucky_criteria_methods'

module Kaminari
  module MongoMapperExtension
    module Document
      extend ActiveSupport::Concern
      include Kaminari::ConfigurationMethods

      included do
        # Fetch the values at the specified page number
        #   Model.page(5)
        scope Kaminari.config.page_method_name, Proc.new {|num|
          limit(default_per_page).offset(default_per_page * ([num.to_i, 1].max - 1))
        }
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 8 rubygems

Version Path
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/kaminari-0.13.0/lib/kaminari/models/mongo_mapper_extension.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/kaminari-0.13.0/lib/kaminari/models/mongo_mapper_extension.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/kaminari-0.13.0/lib/kaminari/models/mongo_mapper_extension.rb
kaminari-0.13.0 lib/kaminari/models/mongo_mapper_extension.rb