Sha256: 1271995eb6b552d9f6fc456867fd51bbc877515d8e7e63aba3b5fe3577ee8b33

Contents?: true

Size: 480 Bytes

Versions: 24

Compression:

Stored size: 480 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)
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
decidim-core-0.26.8 app/jobs/decidim/open_data_job.rb
decidim-core-0.27.4 app/jobs/decidim/open_data_job.rb
decidim-core-0.27.3 app/jobs/decidim/open_data_job.rb
decidim-core-0.26.7 app/jobs/decidim/open_data_job.rb
decidim-core-0.26.5 app/jobs/decidim/open_data_job.rb
decidim-core-0.27.2 app/jobs/decidim/open_data_job.rb
decidim-core-0.27.1 app/jobs/decidim/open_data_job.rb
decidim-core-0.26.4 app/jobs/decidim/open_data_job.rb
decidim-core-0.27.0 app/jobs/decidim/open_data_job.rb
decidim-core-0.26.3 app/jobs/decidim/open_data_job.rb
decidim-core-0.27.0.rc2 app/jobs/decidim/open_data_job.rb
decidim-core-0.27.0.rc1 app/jobs/decidim/open_data_job.rb
decidim-core-0.26.2 app/jobs/decidim/open_data_job.rb
decidim-core-0.26.1 app/jobs/decidim/open_data_job.rb
decidim-core-0.26.0 app/jobs/decidim/open_data_job.rb
decidim-core-0.26.0.rc2 app/jobs/decidim/open_data_job.rb
decidim-core-0.26.0.rc1 app/jobs/decidim/open_data_job.rb
decidim-core-0.25.2 app/jobs/decidim/open_data_job.rb
decidim-core-0.25.1 app/jobs/decidim/open_data_job.rb
decidim-core-0.25.0 app/jobs/decidim/open_data_job.rb