Sha256: 98cca6dd828984ec7e3a7e3cfefaaca92c1d2601b5d9c70b142a812104003cfc

Contents?: true

Size: 659 Bytes

Versions: 7

Compression:

Stored size: 659 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Initiatives
    module Admin
      # Controller that allows managing all the attachments for an initiative
      class InitiativeAttachmentsController < Decidim::Initiatives::Admin::ApplicationController
        include InitiativeAdmin
        include Decidim::Admin::Concerns::HasAttachments

        def after_destroy_path
          initiative_attachments_path(current_initiative)
        end

        def attached_to
          current_initiative
        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-initiatives-0.13.1 app/controllers/decidim/initiatives/admin/initiative_attachments_controller.rb
decidim-initiatives-0.12.2 app/controllers/decidim/initiatives/admin/initiative_attachments_controller.rb
decidim-initiatives-0.13.0 app/controllers/decidim/initiatives/admin/initiative_attachments_controller.rb
decidim-initiatives-0.12.1 app/controllers/decidim/initiatives/admin/initiative_attachments_controller.rb
decidim-initiatives-0.13.0.pre1 app/controllers/decidim/initiatives/admin/initiative_attachments_controller.rb
decidim-initiatives-0.12.0 app/controllers/decidim/initiatives/admin/initiative_attachments_controller.rb
decidim-initiatives-0.12.0.pre app/controllers/decidim/initiatives/admin/initiative_attachments_controller.rb