Sha256: 037215678f99e45bbeb5d92644962e477053c2440dca52409b0d61fd2d310476

Contents?: true

Size: 827 Bytes

Versions: 8

Compression:

Stored size: 827 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module ActionDelegator
    module Admin
      module Consultations
        class ExportsController < ActionDelegator::Admin::ApplicationController
          include NeedsPermission
          include Decidim::Consultations::NeedsConsultation

          def create
            enforce_permission_to :export_consultation_results, :consultation, consultation: current_consultation

            ExportConsultationResultsJob.perform_later(current_user, current_consultation, type)

            flash[:notice] = t("decidim.admin.exports.notice")
            redirect_back(fallback_location: decidim_admin_consultations.results_consultation_path(current_consultation))
          end

          def type
            "type_and_weight"
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
decidim-action_delegator-0.8.1 app/controllers/decidim/action_delegator/admin/consultations/exports_controller.rb
decidim-action_delegator-0.7.2 app/controllers/decidim/action_delegator/admin/consultations/exports_controller.rb
decidim-action_delegator-0.7.1 app/controllers/decidim/action_delegator/admin/consultations/exports_controller.rb
decidim-action_delegator-0.7.0 app/controllers/decidim/action_delegator/admin/consultations/exports_controller.rb
decidim-action_delegator-0.6.0 app/controllers/decidim/action_delegator/admin/consultations/exports_controller.rb
decidim-action_delegator-0.5.0 app/controllers/decidim/action_delegator/admin/consultations/exports_controller.rb
decidim-action_delegator-0.4.1 app/controllers/decidim/action_delegator/admin/consultations/exports_controller.rb
decidim-action_delegator-0.4 app/controllers/decidim/action_delegator/admin/consultations/exports_controller.rb