Class: Decidim::OpenDataJob

Inherits:
ApplicationJob show all
Defined in:
decidim-core/app/jobs/decidim/open_data_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(organization) ⇒ Object


7
8
9
10
11
12
13
14
# File 'decidim-core/app/jobs/decidim/open_data_job.rb', line 7

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?

  OpenDataUploader.new(organization).store!(File.open(path, "rb"))
end