Sha256: 7d96af8c2751eae574c6613515eee0d43787ef6b41fc1b4d9605e98c88e33bee

Contents?: true

Size: 719 Bytes

Versions: 19

Compression:

Stored size: 719 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Budgets
    module Admin
      # Controller that allows managing all the attachments for a participatory
      # process.
      #
      class AttachmentsController < Admin::ApplicationController
        include Decidim::Admin::Concerns::HasAttachments

        def after_destroy_path
          budget_projects_path(project.budget)
        end

        def attached_to
          project
        end

        def projects
          @projects ||= Decidim::Budgets::Project.joins(:budget).where(budget: { component: current_component })
        end

        def project
          @project ||= projects.find(params[:project_id])
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
decidim-budgets-0.29.1 app/controllers/decidim/budgets/admin/attachments_controller.rb
decidim-budgets-0.28.4 app/controllers/decidim/budgets/admin/attachments_controller.rb
decidim-budgets-0.27.9 app/controllers/decidim/budgets/admin/attachments_controller.rb
decidim-budgets-0.29.0 app/controllers/decidim/budgets/admin/attachments_controller.rb
decidim-budgets-0.28.3 app/controllers/decidim/budgets/admin/attachments_controller.rb
decidim-budgets-0.27.8 app/controllers/decidim/budgets/admin/attachments_controller.rb
decidim-budgets-0.29.0.rc4 app/controllers/decidim/budgets/admin/attachments_controller.rb
decidim-budgets-0.29.0.rc3 app/controllers/decidim/budgets/admin/attachments_controller.rb
decidim-budgets-0.29.0.rc2 app/controllers/decidim/budgets/admin/attachments_controller.rb
decidim-budgets-0.29.0.rc1 app/controllers/decidim/budgets/admin/attachments_controller.rb
decidim-budgets-0.28.2 app/controllers/decidim/budgets/admin/attachments_controller.rb
decidim-budgets-0.27.7 app/controllers/decidim/budgets/admin/attachments_controller.rb
decidim-budgets-0.28.1 app/controllers/decidim/budgets/admin/attachments_controller.rb
decidim-budgets-0.27.6 app/controllers/decidim/budgets/admin/attachments_controller.rb
decidim-budgets-0.28.0 app/controllers/decidim/budgets/admin/attachments_controller.rb
decidim-budgets-0.27.5 app/controllers/decidim/budgets/admin/attachments_controller.rb
decidim-budgets-0.28.0.rc5 app/controllers/decidim/budgets/admin/attachments_controller.rb
decidim-budgets-0.28.0.rc4 app/controllers/decidim/budgets/admin/attachments_controller.rb
decidim-budgets-0.27.4 app/controllers/decidim/budgets/admin/attachments_controller.rb