Sha256: 4412ff5860670f5540f63fcd3ddddacc2873b7c2ed3186cb6d09072cbc8e48c7

Contents?: true

Size: 672 Bytes

Versions: 8

Compression:

Stored size: 672 Bytes

Contents

module MeiliSearch
  module Rails
    module Pagination
      autoload :WillPaginate, 'meilisearch/rails/pagination/will_paginate'
      autoload :Kaminari, 'meilisearch/rails/pagination/kaminari'

      def self.create(results, total_hits, options = {})
        return results if MeiliSearch::Rails.configuration[:pagination_backend].nil?

        begin
          backend = MeiliSearch::Rails.configuration[:pagination_backend].to_s.classify

          ::MeiliSearch::Rails::Pagination.const_get(backend).create(results, total_hits, options)
        rescue NameError
          raise(BadConfiguration, 'Unknown pagination backend')
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
meilisearch-rails-0.7.3 lib/meilisearch/rails/pagination.rb
meilisearch-rails-0.7.2 lib/meilisearch/rails/pagination.rb
meilisearch-rails-0.7.1 lib/meilisearch/rails/pagination.rb
meilisearch-rails-0.7.0 lib/meilisearch/rails/pagination.rb
meilisearch-rails-0.6.0 lib/meilisearch/rails/pagination.rb
meilisearch-rails-0.5.2 lib/meilisearch/rails/pagination.rb
meilisearch-rails-0.5.1 lib/meilisearch/rails/pagination.rb
meilisearch-rails-0.5.0 lib/meilisearch/rails/pagination.rb