Add group name on heading options if more than one heading per group

This commit is contained in:
Bertocq
2018-01-22 19:43:54 +01:00
parent 9bb088a5c7
commit ce3bf20152

View File

@@ -17,7 +17,7 @@ class Budget
scope :order_by_group_name, -> { includes(:group).order('budget_groups.name', 'budget_headings.name') } scope :order_by_group_name, -> { includes(:group).order('budget_groups.name', 'budget_headings.name') }
def name_scoped_by_group def name_scoped_by_group
"#{group.name}: #{name}" group.single_heading_group? ? name : "#{group.name}: #{name}"
end end
def name_exists_in_budget_headings def name_exists_in_budget_headings