Sha256: 27ad2b3944c3501676045b4d64d40aa66a0dc7d8b460941a9ca954f0e52cb4a7
Contents?: true
Size: 1.06 KB
Versions: 19
Compression:
Stored size: 1.06 KB
Contents
require 'kaminari' module Europeana module Blacklight class Response ## # Pagination for{Europeana::Blacklight::Response} # # Based on {Blacklight::SolrResponse::Pagination} v5.10.2 module Pagination include Kaminari::PageScopeMethods include Kaminari::ConfigurationMethods::ClassMethods extend ActiveSupport::Concern def limit_value rows end def offset_value start end def total_count total end def model_name return unless docs.present? && docs.first.respond_to?(:model_name) docs.first.model_name end def max_pages (defined?(@_max_pages) && @_max_pages) || (1000 / limit_value) end def total_pages total = super total > max_pages ? max_pages : total end def next_page current_page + 1 unless last_page? end def prev_page current_page - 1 unless first_page? end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems