Sha256: ed3ffc4d489c921b96fc6f6239787b486e30edd7d2ca91a51d52ffcb968fa4a7
Contents?: true
Size: 844 Bytes
Versions: 16
Compression:
Stored size: 844 Bytes
Contents
# frozen_string_literal: true module Decidim module Budgets module Admin # This controller is the abstract class from which all other controllers of # this engine inherit. # # Note that it inherits from `Decidim::Components::BaseController`, which # override its layout and provide all kinds of useful methods. class ApplicationController < Decidim::Admin::Components::BaseController helper_method :budget, :projects, :project def budget @budget ||= Budget.where(component: current_component).includes(:projects).find_by(id: params[:budget_id]) end def projects return unless budget @projects ||= budget.projects end def project @project ||= projects.find(params[:id]) end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems