Files
nairobi/app/controllers/valuation/budgets_controller.rb
rgarcia 5086314bee Display only current budget for Valuators
Before we could have multiple current budgets, as we now only have one
current_budget, some specs broke.

As there is no need to display multiple budgets to Valuators, only the
current budget is necessary, we can remove arrays and assume that only
a single budget, the current budget, is displayed to Valuators
2018-01-15 22:02:04 +01:00

18 lines
542 B
Ruby

class Valuation::BudgetsController < Valuation::BaseController
include FeatureFlags
feature_flag :budgets
load_and_authorize_resource
def index
@budget = Budget.current
if @budget.present?
@investments_with_valuation_open = {}
@investments_with_valuation_open = @budget.investments
.by_valuator(current_user.valuator.try(:id))
.valuation_open
.count
end
end
end