Sha256: 1f57089f5293c4a42c30bb90e4b47c9c03af5afeca61f64d64ea3cfc97cf5386

Contents?: true

Size: 603 Bytes

Versions: 31

Compression:

Stored size: 603 Bytes

Contents

# frozen_string_literal: true

module Decidim
  class ExportJob < ApplicationJob
    queue_as :exports

    def perform(user, component, name, format, resource_id = nil)
      export_manifest = component.manifest.export_manifests.find do |manifest|
        manifest.name == name.to_sym
      end

      collection = export_manifest.collection.call(component, user, resource_id)
      serializer = export_manifest.serializer

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

      ExportMailer.export(user, name, export_data).deliver_now
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
decidim-core-0.27.9 app/jobs/decidim/export_job.rb
decidim-core-0.27.8 app/jobs/decidim/export_job.rb
decidim-core-0.27.7 app/jobs/decidim/export_job.rb
decidim-core-0.27.6 app/jobs/decidim/export_job.rb
decidim-core-0.26.10 app/jobs/decidim/export_job.rb
decidim-core-0.26.9 app/jobs/decidim/export_job.rb
decidim-core-0.27.5 app/jobs/decidim/export_job.rb
decidim-core-0.26.8 app/jobs/decidim/export_job.rb
decidim-core-0.27.4 app/jobs/decidim/export_job.rb
decidim-core-0.27.3 app/jobs/decidim/export_job.rb
decidim-core-0.26.7 app/jobs/decidim/export_job.rb
decidim-core-0.26.5 app/jobs/decidim/export_job.rb
decidim-core-0.27.2 app/jobs/decidim/export_job.rb
decidim-core-0.27.1 app/jobs/decidim/export_job.rb
decidim-core-0.26.4 app/jobs/decidim/export_job.rb
decidim-core-0.27.0 app/jobs/decidim/export_job.rb
decidim-core-0.26.3 app/jobs/decidim/export_job.rb
decidim-core-0.27.0.rc2 app/jobs/decidim/export_job.rb
decidim-core-0.27.0.rc1 app/jobs/decidim/export_job.rb
decidim-core-0.26.2 app/jobs/decidim/export_job.rb