Sha256: 04f84bfd9dc098c2b11233bf0b6d8baf3ba59bd6d308eb21743733e22705cb2c
Contents?: true
Size: 502 Bytes
Versions: 8
Compression:
Stored size: 502 Bytes
Contents
module Schemas class Paginate < PaginationSearch::HashPaginate protected def searched(items, search) search = expand_dot_notation(search) if /\A[A-z]+\.[A-z]+\z/ =~ search super(items, search) end def sorted(items, _) items.sort_by { |i| "#{i[:schema]}.#{i[:table]}.#{i[:column]}" }.reverse end private def expand_dot_notation(search) schema, table = search.split('.') "schema:#{schema} table:#{table} match_type:exact" end end end
Version data entries
8 entries across 8 versions & 1 rubygems