Module: Card::Set::Abstract::Search::Format

Extended by:
Card::Set::AbstractFormat
Defined in:
card/tmpsets/set/mod035-card-mod-search/abstract/05_search.rb,
card/tmpsets/set/mod036-card-mod-search/abstract/05_search.rb

Instance Method Summary collapse

Instance Method Details

#count_with_paramsObject



66
67
68
# File 'card/tmpsets/set/mod035-card-mod-search/abstract/05_search.rb', line 66

def count_with_params
  @count_with_params ||= search_with_rescue search_params.merge(return: :count)
end

#implicit_item_viewObject



83
84
85
86
# File 'card/tmpsets/set/mod035-card-mod-search/abstract/05_search.rb', line 83

def implicit_item_view
  view = voo_items_view || default_item_view
  Card::View.normalize view
end

#rescuing_bad_query(query_args) ⇒ Object



76
77
78
79
80
81
# File 'card/tmpsets/set/mod035-card-mod-search/abstract/05_search.rb', line 76

def rescuing_bad_query query_args
  yield
rescue Error::BadQuery => e
  Rails.logger.info "BadQuery: #{query_args}"
  e
end

#search_with_paramsObject



62
63
64
# File 'card/tmpsets/set/mod035-card-mod-search/abstract/05_search.rb', line 62

def search_with_params
  @search_with_params ||= search_with_rescue search_params
end

#search_with_rescue(query_args) ⇒ Object



70
71
72
73
74
# File 'card/tmpsets/set/mod035-card-mod-search/abstract/05_search.rb', line 70

def search_with_rescue query_args
  rescuing_bad_query query_args do
    card.cached_search query_args
  end
end

#view: filtered_countObject



70
71
72
# File 'card/tmpsets/set/mod036-card-mod-search/abstract/05_search.rb', line 70

view :filtered_count, cache: :never do
  count_with_params
end