Sha256: cf24b151f8f8e2d01ad1033227081a35caf4730214d5cda1989a8a3dd6de48d6

Contents?: true

Size: 678 Bytes

Versions: 7

Compression:

Stored size: 678 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Consultations
    module Admin
      # Controller that allows managing all the attachments for a question
      class QuestionAttachmentsController < Decidim::Consultations::Admin::ApplicationController
        include QuestionAdmin
        include Decidim::Admin::Concerns::HasAttachments

        def after_destroy_path
          decidim_admin_consultations.question_attachments_path(current_question)
        end

        def attached_to
          current_question
        end

        def authorization_object
          collection.find_by(id: params[:id]) || Decidim::Attachment
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
decidim-consultations-0.13.1 app/controllers/decidim/consultations/admin/question_attachments_controller.rb
decidim-consultations-0.12.2 app/controllers/decidim/consultations/admin/question_attachments_controller.rb
decidim-consultations-0.13.0 app/controllers/decidim/consultations/admin/question_attachments_controller.rb
decidim-consultations-0.12.1 app/controllers/decidim/consultations/admin/question_attachments_controller.rb
decidim-consultations-0.13.0.pre1 app/controllers/decidim/consultations/admin/question_attachments_controller.rb
decidim-consultations-0.12.0 app/controllers/decidim/consultations/admin/question_attachments_controller.rb
decidim-consultations-0.12.0.pre app/controllers/decidim/consultations/admin/question_attachments_controller.rb