Adds simple Budget specs

This commit is contained in:
kikito
2016-05-20 17:56:05 +02:00
parent cf0b7a53b0
commit fdc8636e12
3 changed files with 29 additions and 1 deletions

View File

@@ -1,5 +1,12 @@
class Budget < ActiveRecord::Base
VALID_PHASES = %W{on_hold accepting selecting balloting finished}
validates :phase, inclusion: { in: VALID_PHASES }
has_many :investments
has_many :ballots
def on_hold?
phase == "on_hold"
end
@@ -20,4 +27,5 @@ class Budget < ActiveRecord::Base
phase == "finished"
end
end
end