Sha256: 314a3b05a45d186a814c9097157174bb043634d88b565467ba2d6cc69b9068fa

Contents?: true

Size: 545 Bytes

Versions: 13

Compression:

Stored size: 545 Bytes

Contents

# frozen_string_literal: true

module Decidim
  class OpenDataJob < ApplicationJob
    queue_as :exports

    def perform(organization)
      path = Rails.root.join("tmp/#{organization.open_data_file_path}")

      exporter = OpenDataExporter.new(organization, path)
      raise "Could not generate Open Data export" unless exporter.export.positive?

      organization.open_data_file.attach(io: File.open(path, "rb"), filename: organization.open_data_file_path)
      # Deletes the temporary file file
      File.delete(path)
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-core-0.29.1 app/jobs/decidim/open_data_job.rb
decidim-core-0.28.4 app/jobs/decidim/open_data_job.rb
decidim-core-0.29.0 app/jobs/decidim/open_data_job.rb
decidim-core-0.28.3 app/jobs/decidim/open_data_job.rb
decidim-core-0.29.0.rc4 app/jobs/decidim/open_data_job.rb
decidim-core-0.29.0.rc3 app/jobs/decidim/open_data_job.rb
decidim-core-0.29.0.rc2 app/jobs/decidim/open_data_job.rb
decidim-core-0.29.0.rc1 app/jobs/decidim/open_data_job.rb
decidim-core-0.28.2 app/jobs/decidim/open_data_job.rb
decidim-core-0.28.1 app/jobs/decidim/open_data_job.rb
decidim-core-0.28.0 app/jobs/decidim/open_data_job.rb
decidim-core-0.28.0.rc5 app/jobs/decidim/open_data_job.rb
decidim-core-0.28.0.rc4 app/jobs/decidim/open_data_job.rb