Adds sanitized descriptions for all phases to budget model

This commit is contained in:
kikito
2017-01-01 12:51:17 +01:00
parent c17dcf1bab
commit d80dedaad8
5 changed files with 49 additions and 7 deletions

View File

@@ -27,6 +27,10 @@ class Budget < ActiveRecord::Base
scope :current, -> { where.not(phase: "finished") }
def description
self.send("description_#{self.phase}").try(:html_safe)
end
def accepting?
phase == "accepting"
end