do not recalculate GroupOrder totals, but show message to do so on migrations

This commit is contained in:
wvengen 2013-09-18 18:33:49 +02:00
parent ebb22ccb53
commit 2d549fc1da

View file

@ -1,10 +1,16 @@
class UpdateGroupOrderTotals < ActiveRecord::Migration class UpdateGroupOrderTotals < ActiveRecord::Migration
def self.up def self.up
# The group_order total was updated to the total ordered amount instead of say "If you have ever modified an order after it was settled, the group_order's " +
# the amount received. Now this is fixed, the totals need to be updated. "price may be calculated incorrectly. This can take a lot of time on a " +
GroupOrder.all.each do |go| "large database."
go.order.closed? and go.update_price!
end say "If you do want to update the ordergroup totals, open the rails console " +
"(by running `rails c`), and enter:"
say "GroupOrder.all.each { |go| go.order.closed? and go.update_price! }", subitem: true
say "You may want to check first that no undesired accounting issues are introduced. " +
"It may be wise to discuss this with those responsible for the ordering finances."
end end
def self.down def self.down