Sha256: 25ab9bc715011a3ea3975574fdd6bb49fd7764b8b21c0860f4b51acd234ec6fb

Contents?: true

Size: 565 Bytes

Versions: 28

Compression:

Stored size: 565 Bytes

Contents

# frozen_string_literal: true

module Decidim
  class ExportJob < ApplicationJob
    queue_as :default

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

      collection = export_manifest.collection.call(component)
      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

28 entries across 28 versions & 1 rubygems

Version Path
decidim-core-0.20.1 app/jobs/decidim/export_job.rb
decidim-core-0.20.0 app/jobs/decidim/export_job.rb
decidim-core-0.19.1 app/jobs/decidim/export_job.rb
decidim-core-0.18.1 app/jobs/decidim/export_job.rb
decidim-core-0.19.0 app/jobs/decidim/export_job.rb
decidim-core-0.17.2 app/jobs/decidim/export_job.rb
decidim-core-0.18.0 app/jobs/decidim/export_job.rb
decidim-core-0.17.1 app/jobs/decidim/export_job.rb
decidim-core-0.16.1 app/jobs/decidim/export_job.rb
decidim-core-0.17.0 app/jobs/decidim/export_job.rb
decidim-core-0.16.0 app/jobs/decidim/export_job.rb
decidim-core-0.15.2 app/jobs/decidim/export_job.rb
decidim-core-0.15.1 app/jobs/decidim/export_job.rb
decidim-core-0.15.0 app/jobs/decidim/export_job.rb
decidim-core-0.14.4 app/jobs/decidim/export_job.rb
decidim-core-0.14.3 app/jobs/decidim/export_job.rb
decidim-core-0.14.2 app/jobs/decidim/export_job.rb
decidim-core-0.14.1 app/jobs/decidim/export_job.rb
decidim-core-0.13.1 app/jobs/decidim/export_job.rb
decidim-core-0.12.2 app/jobs/decidim/export_job.rb