Files
grecia/app/controllers/valuation/budgets_controller.rb
2017-01-04 18:48:01 +01:00

18 lines
589 B
Ruby

class Valuation::BudgetsController < Valuation::BaseController
include FeatureFlags
feature_flag :budgets
load_and_authorize_resource
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