Sha256: 5bbc71b299e8cb83ef395403beaf5889418273a606909a133e146a78528a9b7b

Contents?: true

Size: 559 Bytes

Versions: 34

Compression:

Stored size: 559 Bytes

Contents

# frozen_string_literal: true

module Decidim
  class ExportJob < ApplicationJob
    queue_as :default

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

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

34 entries across 34 versions & 2 rubygems

Version Path
decidim-core-0.10.1 app/jobs/decidim/export_job.rb
decidim-core-0.10.0 app/jobs/decidim/export_job.rb
decidim-core-0.9.3 app/jobs/decidim/export_job.rb
decidim-core-0.9.2 app/jobs/decidim/export_job.rb
decidim-core-0.9.1 app/jobs/decidim/export_job.rb
decidim-core-0.9.0 app/jobs/decidim/export_job.rb
decidim-core-0.8.4 app/jobs/decidim/export_job.rb
decidim-core-0.8.3 app/jobs/decidim/export_job.rb
decidim-core-0.8.2 app/jobs/decidim/export_job.rb
decidim-core-0.8.1 app/jobs/decidim/export_job.rb
decidim-core-0.8.0 app/jobs/decidim/export_job.rb
decidim-core-0.7.4 app/jobs/decidim/export_job.rb
decidim-core-0.7.3 app/jobs/decidim/export_job.rb
decidim-core-0.7.2 app/jobs/decidim/export_job.rb
decidim-core-0.7.1 app/jobs/decidim/export_job.rb
decidim-core-0.7.0 app/jobs/decidim/export_job.rb
decidim-core-0.6.8 app/jobs/decidim/export_job.rb
decidim-0.6.8 decidim-core/app/jobs/decidim/export_job.rb
decidim-core-0.6.7 app/jobs/decidim/export_job.rb
decidim-0.6.7 decidim-core/app/jobs/decidim/export_job.rb