Sha256: 954e23a91398a3f96613e873865a62698ec5a96204b86e76be64803f4643058f

Contents?: true

Size: 535 Bytes

Versions: 15

Compression:

Stored size: 535 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Initiatives
    class ExportInitiativesJob < ApplicationJob
      queue_as :default

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

        ExportMailer.export(user, "initiatives", export_data).deliver_now
      end

      private

      def collection
        Decidim::Initiative.all
      end

      def serializer
        Decidim::Initiatives::InitiativeSerializer
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
decidim-initiatives-0.24.3 app/jobs/decidim/initiatives/export_initiatives_job.rb
decidim-initiatives-0.23.6 app/jobs/decidim/initiatives/export_initiatives_job.rb
decidim-initiatives-0.24.2 app/jobs/decidim/initiatives/export_initiatives_job.rb
decidim-initiatives-0.23.5 app/jobs/decidim/initiatives/export_initiatives_job.rb
decidim-initiatives-0.24.1 app/jobs/decidim/initiatives/export_initiatives_job.rb
decidim-initiatives-0.24.0 app/jobs/decidim/initiatives/export_initiatives_job.rb
decidim-initiatives-0.24.0.rc2 app/jobs/decidim/initiatives/export_initiatives_job.rb
decidim-initiatives-0.23.4 app/jobs/decidim/initiatives/export_initiatives_job.rb
decidim-initiatives-0.24.0.rc1 app/jobs/decidim/initiatives/export_initiatives_job.rb
decidim-initiatives-0.23.3 app/jobs/decidim/initiatives/export_initiatives_job.rb
decidim-initiatives-0.23.2 app/jobs/decidim/initiatives/export_initiatives_job.rb
decidim-initiatives-0.23.1 app/jobs/decidim/initiatives/export_initiatives_job.rb
decidim-initiatives-0.23.1.rc1 app/jobs/decidim/initiatives/export_initiatives_job.rb
decidim-initiatives-0.23.0 app/jobs/decidim/initiatives/export_initiatives_job.rb
decidim-initiatives-0.22.0 app/jobs/decidim/initiatives/export_initiatives_job.rb