Use budget.investments instead of by_budget
Same result, with less code.
This commit is contained in:
@@ -54,13 +54,13 @@ module BudgetsHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def investment_tags_select_options(budget)
|
def investment_tags_select_options(budget)
|
||||||
tags = Budget::Investment.by_budget(budget).tags_on(:valuation).order(:name).pluck(:name)
|
tags = budget.investments.tags_on(:valuation).order(:name).pluck(:name)
|
||||||
tags = tags.concat budget.budget_valuation_tags.split(",") if budget.budget_valuation_tags.present?
|
tags = tags.concat budget.budget_valuation_tags.split(",") if budget.budget_valuation_tags.present?
|
||||||
tags.uniq
|
tags.uniq
|
||||||
end
|
end
|
||||||
|
|
||||||
def investment_milestone_tags_select_options(budget)
|
def investment_milestone_tags_select_options(budget)
|
||||||
tags = Budget::Investment.by_budget(budget).tags_on(:milestone).order(:name).pluck(:name)
|
tags = budget.investments.tags_on(:milestone).order(:name).pluck(:name)
|
||||||
tags = tags.concat budget.budget_milestone_tags.split(",") if budget.budget_milestone_tags.present?
|
tags = tags.concat budget.budget_milestone_tags.split(",") if budget.budget_milestone_tags.present?
|
||||||
tags.uniq
|
tags.uniq
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user