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.6.6 app/jobs/decidim/export_job.rb
decidim-0.6.6 decidim-core/app/jobs/decidim/export_job.rb
decidim-core-0.6.5 app/jobs/decidim/export_job.rb
decidim-0.6.5 decidim-core/app/jobs/decidim/export_job.rb
decidim-core-0.6.4 app/jobs/decidim/export_job.rb
decidim-0.6.4 decidim-core/app/jobs/decidim/export_job.rb
decidim-core-0.6.3 app/jobs/decidim/export_job.rb
decidim-0.6.3 decidim-core/app/jobs/decidim/export_job.rb
decidim-core-0.6.2 app/jobs/decidim/export_job.rb
decidim-0.6.2 decidim-core/app/jobs/decidim/export_job.rb
decidim-core-0.6.1 app/jobs/decidim/export_job.rb
decidim-0.6.1 decidim-core/app/jobs/decidim/export_job.rb
decidim-core-0.6.0 app/jobs/decidim/export_job.rb
decidim-0.6.0 decidim-core/app/jobs/decidim/export_job.rb