Simplify scope usage
Rails automatically calls the `id` method inside scopes and the variable name makes more sense if it represents investments instead of the number of investments.
This commit is contained in:
@@ -7,10 +7,9 @@ class Valuation::BudgetsController < Valuation::BaseController
|
||||
def index
|
||||
@budget = current_budget
|
||||
if @budget.present?
|
||||
@investments_with_valuation_open = @budget.investments
|
||||
.by_valuator(current_user.valuator.try(:id))
|
||||
.valuation_open
|
||||
.count
|
||||
@investments = @budget.investments
|
||||
.by_valuator(current_user.valuator)
|
||||
.valuation_open
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<%= t("budgets.phase.#{@budget.phase}") %>
|
||||
</td>
|
||||
<td>
|
||||
<%= @investments_with_valuation_open %>
|
||||
<%= @investments.count %>
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to t("valuation.budgets.index.evaluate"),
|
||||
|
||||
Reference in New Issue
Block a user