Sha256: d799e0d036679eec5c6b11fc5918e5294298a1a928f854655925dcc2ae122e34
Contents?: true
Size: 813 Bytes
Versions: 28
Compression:
Stored size: 813 Bytes
Contents
module Workarea module Admin class SearchCustomizationProductRulesViewModel < ProductRulesPreviewViewModel # Fetches search results of products for product search. Extends # search class with {Search::AdminProductRulesPreview} to allow # overriding display rules. # # @return [Workarea::Search::ProductSearch] # enumerable collection of the search results # def search @search ||= Search::ProductSearch.new( q: model.query, rules: model.product_rules.usable, page: options[:page] || 1, show_all: show_all? ).tap { |s| s.extend(Search::AdminProductRulesPreview) } end def display_results? true # With query we can always show preview even without rules end end end end
Version data entries
28 entries across 28 versions & 1 rubygems