Sha256: 9f74b3f1a1fd04ce81606907a7eaf9b381c2732ffcd1f931f75403145a67821d

Contents?: true

Size: 725 Bytes

Versions: 62

Compression:

Stored size: 725 Bytes

Contents

module Workarea
  module Insights
    class PopularSearchesWithoutResults < Base
      class << self
        def dashboards
          %w(search)
        end

        def generate_monthly!
          results = generate_results
          create!(results: results) if results.present?
        end

        def generate_results
          report.results.take(Workarea.config.insights_searches_list_max_results)
        end

        def report
          Reports::Searches.new(
            starts_at: beginning_of_last_month,
            ends_at: end_of_last_month,
            results_filter: 'without_results',
            sort_by: 'searches',
            sort_direction: 'desc'
          )
        end
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.4.13 app/models/workarea/insights/popular_searches_without_results.rb
workarea-core-3.4.12 app/models/workarea/insights/popular_searches_without_results.rb