creates setter association for budget investments

This commit is contained in:
rgarcia
2016-07-27 13:04:52 +02:00
parent 82db8bb673
commit 464673a7aa

View File

@@ -18,6 +18,8 @@ class Budget
has_many :valuators, through: :valuator_assignments
has_many :comments, as: :commentable
delegate :budget, to: :heading
validates :title, presence: true
validates :author, presence: true
validates :description, presence: true
@@ -118,6 +120,10 @@ class Budget
heading.group.budget
end
def budget=(resource)
heading.group.budget = resource
end
def undecided?
feasibility == "undecided"
end