Class: Workarea::Insights::UpcomingReleases

Inherits:
Base
  • Object
show all
Defined in:
app/models/workarea/insights/upcoming_releases.rb

Class Method Summary collapse

Methods inherited from Base

beginning_of_last_month, current, end_of_last_month, generate_daily!, generate_weekly!, #include?, #slug

Methods included from ApplicationDocument

#releasable?

Methods included from Sidekiq::Callbacks

assert_valid_config!, async, disable, enable, inline, #run_callbacks

Methods included from Mongoid::Document

#embedded_children

Class Method Details

.dashboardsObject



5
6
7
# File 'app/models/workarea/insights/upcoming_releases.rb', line 5

def dashboards
  %w(store)
end

.generate_monthly!Object



9
10
11
12
13
14
15
16
# File 'app/models/workarea/insights/upcoming_releases.rb', line 9

def generate_monthly!
  releases = Release
    .scheduled
    .soonest
    .limit(Workarea.config.insights_releases_list_max_results)

  create!(results: releases.map { |r| { release_id: r.id } }) if releases.present?
end