adds phase scopes to budget
This commit is contained in:
committed by
Juanjo Bazán
parent
f24a8887bb
commit
baddfdb3d1
@@ -10,6 +10,9 @@ class Budget < ActiveRecord::Base
|
||||
has_many :headings, through: :groups
|
||||
has_many :investments, through: :headings
|
||||
|
||||
scope :open, -> { where.not(phase: "finished") }
|
||||
scope :finished, -> { where(phase: "finished") }
|
||||
|
||||
def on_hold?
|
||||
phase == "on_hold"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user