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.
15 lines
328 B
Ruby
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
|