From 0fc1e0503e939ce1b6daf04d718eb5c441266ecd Mon Sep 17 00:00:00 2001 From: Julian Herrero Date: Wed, 5 Dec 2018 13:13:49 +0100 Subject: [PATCH] store reclassified votes in order Make sure we create Budget::ReclassifiedVotes for an investment in the same order that the previous Budget::Ballot:Lines were previously created. --- app/models/budget/reclassification.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/budget/reclassification.rb b/app/models/budget/reclassification.rb index b77dc374a..7eefc0d33 100644 --- a/app/models/budget/reclassification.rb +++ b/app/models/budget/reclassification.rb @@ -30,7 +30,7 @@ class Budget end def store_reclassified_votes(reason) - ballot_lines_for_investment.each do |line| + ballot_lines_for_investment.order(:id).each do |line| attrs = { user: line.ballot.user, investment: self, reason: reason }