Sha256: 9a99a077db0413434f380f2496ce7eec72eb2a2eefe267a25c2cbdb1f7a0c1c9
Contents?: true
Size: 646 Bytes
Versions: 81
Compression:
Stored size: 646 Bytes
Contents
# frozen_string_literal: true 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
81 entries across 81 versions & 1 rubygems