Sha256: 63651f63ee906778c1ecbaaa89ff7ac9f355db1afbaf5e5366a7ea34b547bba6

Contents?: true

Size: 638 Bytes

Versions: 45

Compression:

Stored size: 638 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Budgets
    # Exposes the budget resources so users can participate on them
    class BudgetsController < Decidim::Budgets::ApplicationController
      def index
        redirect_to budget_projects_path(current_workflow.single) if current_workflow.single?
      end

      def show
        raise ActionController::RoutingError, "Not Found" unless budget

        redirect_to budget_projects_path(budget)
      end

      private

      def budget
        @budget ||= Budget.where(component: current_component).includes(:projects).find_by(id: params[:id])
      end
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
decidim-budgets-0.27.9 app/controllers/decidim/budgets/budgets_controller.rb
decidim-budgets-0.27.8 app/controllers/decidim/budgets/budgets_controller.rb
decidim-budgets-0.27.7 app/controllers/decidim/budgets/budgets_controller.rb
decidim-budgets-0.27.6 app/controllers/decidim/budgets/budgets_controller.rb
decidim-budgets-0.26.10 app/controllers/decidim/budgets/budgets_controller.rb
decidim-budgets-0.26.9 app/controllers/decidim/budgets/budgets_controller.rb
decidim-budgets-0.27.5 app/controllers/decidim/budgets/budgets_controller.rb
decidim-budgets-0.26.8 app/controllers/decidim/budgets/budgets_controller.rb
decidim-budgets-0.27.4 app/controllers/decidim/budgets/budgets_controller.rb
decidim-budgets-0.27.3 app/controllers/decidim/budgets/budgets_controller.rb
decidim-budgets-0.26.7 app/controllers/decidim/budgets/budgets_controller.rb
decidim-budgets-0.26.5 app/controllers/decidim/budgets/budgets_controller.rb
decidim-budgets-0.27.2 app/controllers/decidim/budgets/budgets_controller.rb
decidim-budgets-0.27.1 app/controllers/decidim/budgets/budgets_controller.rb
decidim-budgets-0.26.4 app/controllers/decidim/budgets/budgets_controller.rb
decidim-budgets-0.27.0 app/controllers/decidim/budgets/budgets_controller.rb
decidim-budgets-0.26.3 app/controllers/decidim/budgets/budgets_controller.rb
decidim-budgets-0.27.0.rc2 app/controllers/decidim/budgets/budgets_controller.rb
decidim-budgets-0.27.0.rc1 app/controllers/decidim/budgets/budgets_controller.rb
decidim-budgets-0.26.2 app/controllers/decidim/budgets/budgets_controller.rb