Class: Workarea::Admin::HelpSearchViewModel
Instance Method Summary
collapse
#applied_filters?, #facet_selections, #facets, #filters, #results, #sort, #sorts, #toggle_facets?, #total
Instance Method Details
#top_articles_by_category ⇒ Object
8
9
10
11
12
13
14
|
# File 'app/view_models/workarea/admin/help_search_view_model.rb', line 8
def top_articles_by_category
@top_articles_by_category ||= top_categories.reduce({}) do |memo, category|
articles = Help::Article.in_category(category).recent.top.to_a
memo[category] = articles if articles.present?
memo
end
end
|
#top_categories ⇒ Object
4
5
6
|
# File 'app/view_models/workarea/admin/help_search_view_model.rb', line 4
def top_categories
@top_categories ||= Help::Article.top_categories
end
|