Sha256: 088e611933d239358a8532f69f6519642329c81fe4ba314a01c4f6bf830dda06
Contents?: true
Size: 553 Bytes
Versions: 13
Compression:
Stored size: 553 Bytes
Contents
require 'active_support' class LHS::Record module Last extend ActiveSupport::Concern module ClassMethods def last(options = nil) first_batch = find_by({}, options).parent if first_batch.paginated? pagination = first_batch._pagination find_by({ pagination_key => pagination.class.page_to_offset(pagination.last_page, pagination.limit) }, options) else first_batch.last end end def last!(options = nil) find_by!({}, options) end end end end
Version data entries
13 entries across 13 versions & 1 rubygems