Sha256: cb18fd586e468bf7fcc94abb8b412e50feb3345d73643fb3e5850b56ae69db46

Contents?: true

Size: 610 Bytes

Versions: 44

Compression:

Stored size: 610 Bytes

Contents

# frozen_string_literal: true

module Decidim
  class OpenDataController < Decidim::ApplicationController
    def download
      if uploader.attached?
        redirect_to uploader.path
      else
        schedule_open_data_generation
        flash[:alert] = t("decidim.open_data.not_available_yet")
        redirect_back fallback_location: root_path
      end
    end

    private

    def uploader
      @uploader ||= Decidim::ApplicationUploader.new(current_organization, :open_data_file)
    end

    def schedule_open_data_generation
      OpenDataJob.perform_later(current_organization)
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
decidim-core-0.25.0.rc4 app/controllers/decidim/open_data_controller.rb
decidim-core-0.25.0.rc3 app/controllers/decidim/open_data_controller.rb
decidim-core-0.25.0.rc2 app/controllers/decidim/open_data_controller.rb
decidim-core-0.25.0.rc1 app/controllers/decidim/open_data_controller.rb