Class: Decidim::ActionDelegator::ExportConsultationResultsJob

Inherits:
ApplicationJob
  • Object
show all
Defined in:
app/jobs/decidim/action_delegator/export_consultation_results_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(user, consultation, results_type) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'app/jobs/decidim/action_delegator/export_consultation_results_job.rb', line 8

def perform(user, consultation, results_type)
  @consultation = consultation
  @results_type = results_type.to_sym

  export_data = Decidim::Exporters
                .find_exporter("CSV")
                .new(collection, serializer)
                .export

  Decidim::ExportMailer.export(user, filename, export_data).deliver_now
end