Sha256: ac52cf3180c2eb7093a443a46c6ece021ac29df080435d94e6093976f917a991
Contents?: true
Size: 454 Bytes
Versions: 16
Compression:
Stored size: 454 Bytes
Contents
module PaginationSearch class PaginatedRecords def initialize(base_class, attribute_locations) @attribute_set = AttributeSet.new(base_class, attribute_locations) end def page_for(relation, params) id_relation = relation.select(:id) length = params[:limit].to_i start = params[:offset].to_i * length BaseRelation.new(id_relation, params, @attribute_set).process.limit(length).offset(start) end end end
Version data entries
16 entries across 16 versions & 1 rubygems