Sha256: 9d5b091e95cc7dd980bf18b822a80a2f095188dfa638f9e0d7deec58de104287
Contents?: true
Size: 615 Bytes
Versions: 45
Compression:
Stored size: 615 Bytes
Contents
module SirTrevorRails module Blocks ## # Embed search results (from a browse category) into the page class SearchResultsBlock < SirTrevorRails::Block include Displayable def query_params if search search.query_params else {} end end def search searches.first end def searches @searches ||= parent.exhibit.searches.published.where(slug: item_ids).sort { |a, b| ordered_items.index(a.id) <=> ordered_items.index(b.id) } end def searches? !searches.empty? end end end end
Version data entries
45 entries across 45 versions & 1 rubygems