Sha256: c012e3dcb51863af2db90e0cf10029b5d1dcffe0ff0bbeb4434039151671dacf
Contents?: true
Size: 673 Bytes
Versions: 13
Compression:
Stored size: 673 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.const_get(format.upcase).new(collection, serializer).export name = "#{name}-#{I18n.localize(Date.today, format: :default)}-#{Time.now.seconds_since_midnight.to_i}" ExportMailer.export(user, name, export_data).deliver_now end end end
Version data entries
13 entries across 13 versions & 2 rubygems