Add single_heading_group? helper at Budget::Group model

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

View File

@@ -10,5 +10,8 @@ class Budget
validates :name, presence: true, uniqueness: { scope: :budget }
validates :slug, presence: true, format: /\A[a-z0-9\-_]+\z/
def single_heading_group?
headings.count == 1
end
end
end