Class: Crm::Reports::SourcesReportController
- Inherits:
-
CrmController
- Object
- CrmController
- Crm::Reports::SourcesReportController
- Includes:
- Controllers::ReportCommandFlashable
- Defined in:
- app/controllers/crm/reports/sources_report_controller.rb
Overview
Lead-sources report: opportunity/sales counts and totals grouped by
marketing source, comparing a baseline period against a comparison period.
Instance Method Summary collapse
-
#show ⇒ void
Runs the sources report command for the requested period/source filters and renders the results (HTML or Turbo Stream).
Instance Method Details
#show ⇒ void
This method returns an undefined value.
Runs the sources report command for the requested period/source filters
and renders the results (HTML or Turbo Stream).
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/crm/reports/sources_report_controller.rb', line 14 def show @report_command = ::Report::SourcesReport::SourcesReportCommand.new(sources_report_command_params) @result = @report_command.execute flash_report_command_errors # `warnings` is nil when the command bails out of `execute` early on a # validation failure (it never runs `check_for_warnings`). Guard with # Array() so an invalid form re-render doesn't blow up here. flash.now[:warning] = Array(@report_command.warnings).join('.') if Array(@report_command.warnings).any? respond_to do |format| format.html format.turbo_stream end end |