<commit_before>require 'kaminari/models/mongoid_criteria_methods'

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

      included do
        scope Kaminari.config.page_method_name, Proc.new {|num|
          limit(default_per_page).offset(default_per_page * ((num = num.to_i - 1) < 0 ? 0 : num))
        } do
          include Kaminari::MongoidCriteriaMethods
          include Kaminari::PageScopeMethods
        end
      end

      module ClassMethods
        def inherited(kls)
          super
          kls.send(:include, Kaminari::MongoidExtension::Document.dup)
        end
      end
    end
  end
end<commit_msg>Do not re-define the #page method on mongoid 5.0<commit_after>require 'kaminari/models/mongoid_criteria_methods'

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

      included do
        scope Kaminari.config.page_method_name, Proc.new {|num|
          limit(default_per_page).offset(default_per_page * ((num = num.to_i - 1) < 0 ? 0 : num))
        } do
          include Kaminari::MongoidCriteriaMethods
          include Kaminari::PageScopeMethods
        end
      end

      module ClassMethods
        def inherited(kls)
          super
          kls.send(:include, Kaminari::MongoidExtension::Document.dup)
        end
      end if Mongoid::VERSION < '5.0.0'
    end
  end
end
{'fraction_non_alphanumeric': 0.07501674480910918, 'fraction_numerical': 0.007367716008037508, 'mean_word_length': 2.5656324582338903, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3819204', 'n_tokens_mistral': 449, 'n_tokens_neox': 433, 'n_words': 98}