Sha256: b6dfa8ff596b0ec5b8b00a07e5e94c6b08ad82823a87f70134f0565527911cd5
Contents?: true
Size: 770 Bytes
Versions: 62
Compression:
Stored size: 770 Bytes
Contents
module Workarea module Admin module Insights class SearchViewModel < ApplicationViewModel include InsightsDetails insights_scope -> { Metrics::SearchByDay.by_query_id(model.id) } add_sparkline :orders add_summaries :orders, :searches, :revenue, :units_sold add_graph_data :orders, :searches, :revenue, :units_sold def feed @feed ||= InsightViewModel.wrap( Workarea::Insights::Base.by_search(model.id).to_a ) end def top? Workarea::Insights::PopularSearches.current.include?(_id: model.id) end def trending? Workarea::Insights::TrendingSearches.current.include?(query_id: model.id) end end end end end
Version data entries
62 entries across 62 versions & 1 rubygems