prints the right value in budgets table

This commit is contained in:
kikito
2017-01-04 18:48:01 +01:00
parent 0835a7aba6
commit 635de83f86
4 changed files with 11 additions and 5 deletions

View File

@@ -6,6 +6,12 @@ class Valuation::BudgetsController < Valuation::BaseController
def index
@budgets = @budgets.current.order(created_at: :desc).page(params[:page])
@investments_with_valuation_open = {}
@budgets.each do |b|
@investments_with_valuation_open[b.id] = b.investments
.by_valuator(current_user.valuator.try(:id))
.valuation_open
.count
end
end
end

View File

@@ -7,7 +7,7 @@
<tr>
<th><%= t("valuation.budgets.index.table_name") %></th>
<th><%= t("valuation.budgets.index.table_phase") %></th>
<th><%= t("valuation.budgets.index.table_assigned_headings") %></th>
<th><%= t("valuation.budgets.index.table_assigned_investments_valuation_open") %></th>
<th><%= t("valuation.budgets.index.table_actions") %></th>
</tr>
</thead>
@@ -21,7 +21,7 @@
<%= t("budget.phase.#{budget.phase}") %>
</td>
<td>
3 partidas
<%= @investments_with_valuation_open[budget.id] %>
</td>
<td>
<%= link_to t("valuation.budgets.index.evaluate"),