Files
nairobi/app/components/valuation/budgets/row_component.rb
Senén Rodero Rodríguez 282b8f8697 Load all the published budgets in the valuation interface
As now multiple budget can coexist at the same time it has sense to be able to
browse all the published budgets in the valuation budgets index page.
2023-02-03 11:01:41 +01:00

15 lines
328 B
Ruby

class Valuation::Budgets::RowComponent < ApplicationComponent
attr_reader :budget
with_collection_parameter :budget
delegate :current_user, to: :helpers
def initialize(budget:)
@budget = budget
end
def investments_count
budget.investments.by_valuator(current_user.valuator).valuation_open.count
end
end