cleans up

This commit is contained in:
rgarcia
2017-05-17 20:32:05 +02:00
parent 47f97e342d
commit a63ca9649e
5 changed files with 51 additions and 28 deletions

View File

@@ -21,17 +21,20 @@ class Budget
budget.balloting? && heading_id_changed?
end
def log_heading_change
update_column(:previous_heading_id, heading_id_was)
end
def marked_as_unfeasible?
budget.balloting? && feasibility_changed? && unfeasible?
end
def log_heading_change
update_column(:previous_heading_id, heading_id_was)
end
def store_reclassified_votes(reason)
ballot_lines_for_investment.each do |line|
Budget::ReclassifiedVote.create!(user: line.ballot.user, investment: self, reason: reason)
attrs = { user: line.ballot.user,
investment: self,
reason: reason }
Budget::ReclassifiedVote.create!(attrs)
end
end