Merge pull request #1678 from consul/feature/1601#budget_winner_investments_button

Add button to Calculate Budget Winner investments
This commit is contained in:
Raimond Garcia
2017-06-26 17:41:08 +02:00
committed by GitHub
11 changed files with 71 additions and 10 deletions

View File

@@ -14,10 +14,15 @@ class Admin::BudgetsController < Admin::BaseController
@budget = Budget.includes(groups: :headings).find(params[:id])
end
def new
end
def new; end
def edit
def edit; end
def calculate_winners
return unless @budget.balloting_process?
@budget.headings.each { |heading| Budget::Result.new(@budget, heading).calculate_winners }
redirect_to admin_budget_budget_investments_path(budget_id: @budget.id, filter: 'winners'),
notice: I18n.t("admin.budgets.winners.calculated")
end
def update