Hide single heading select on new budget investment form

This commit is contained in:
decabeza
2020-04-06 14:11:05 +02:00
committed by Javi Martín
parent eb733d1880
commit 0488b3735f
11 changed files with 52 additions and 27 deletions

View File

@@ -25,6 +25,7 @@ class Management::Budgets::InvestmentsController < Management::BaseController
def create
@investment.terms_of_service = "1"
@investment.author = managed_user
@investment.heading = @budget.headings.first if @budget.single_heading?
if @investment.save
notice = t("flash.actions.create.notice", resource_name: Budget::Investment.model_name.human, count: 1)