Sha256: 0460a83ba6ef573122c47c7c8ee82d98f18ebfd5f0919c78f307ea1658fbcffd

Contents?: true

Size: 395 Bytes

Versions: 11

Compression:

Stored size: 395 Bytes

Contents

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

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
kaminari-0.15.0 lib/kaminari/models/mongoid_criteria_methods.rb
kaminari-rails4-0.15.0 lib/kaminari/models/mongoid_criteria_methods.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/kaminari-0.14.1/lib/kaminari/models/mongoid_criteria_methods.rb
kaminari-0.14.1 lib/kaminari/models/mongoid_criteria_methods.rb
kaminari-0.14.0 lib/kaminari/models/mongoid_criteria_methods.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/kaminari-0.13.0/lib/kaminari/models/mongoid_criteria_methods.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/kaminari-0.13.0/lib/kaminari/models/mongoid_criteria_methods.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/kaminari-0.13.0/lib/kaminari/models/mongoid_criteria_methods.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/kaminari-0.13.0/lib/kaminari/models/mongoid_criteria_methods.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/kaminari-0.13.0/lib/kaminari/models/mongoid_criteria_methods.rb
kaminari-0.13.0 lib/kaminari/models/mongoid_criteria_methods.rb