Add single_heading_group? helper at Budget::Group model
This commit is contained in:
@@ -10,5 +10,8 @@ class Budget
|
|||||||
validates :name, presence: true, uniqueness: { scope: :budget }
|
validates :name, presence: true, uniqueness: { scope: :budget }
|
||||||
validates :slug, presence: true, format: /\A[a-z0-9\-_]+\z/
|
validates :slug, presence: true, format: /\A[a-z0-9\-_]+\z/
|
||||||
|
|
||||||
|
def single_heading_group?
|
||||||
|
headings.count == 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user