Sha256: d01ce26eea5e3704af90b0a4e7b018e88802946155d00a5779d8280cada2322a

Contents?: true

Size: 544 Bytes

Versions: 8

Compression:

Stored size: 544 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 "Couldn't 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

8 entries across 8 versions & 1 rubygems

Version Path
decidim-core-0.27.10 app/jobs/decidim/open_data_job.rb
decidim-core-0.27.9 app/jobs/decidim/open_data_job.rb
decidim-core-0.27.8 app/jobs/decidim/open_data_job.rb
decidim-core-0.27.7 app/jobs/decidim/open_data_job.rb
decidim-core-0.27.6 app/jobs/decidim/open_data_job.rb
decidim-core-0.26.10 app/jobs/decidim/open_data_job.rb
decidim-core-0.26.9 app/jobs/decidim/open_data_job.rb
decidim-core-0.27.5 app/jobs/decidim/open_data_job.rb