adds phase scopes to budget

This commit is contained in:
Juanjo Bazán
2016-07-20 13:15:02 +02:00
committed by Juanjo Bazán
parent f24a8887bb
commit baddfdb3d1

View File

@@ -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