From 2d549fc1daf85f81acb3c9b5a8d54bd13641d7db Mon Sep 17 00:00:00 2001 From: wvengen Date: Wed, 18 Sep 2013 18:33:49 +0200 Subject: [PATCH] do not recalculate GroupOrder totals, but show message to do so on migrations --- .../20130702113610_update_group_order_totals.rb | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/db/migrate/20130702113610_update_group_order_totals.rb b/db/migrate/20130702113610_update_group_order_totals.rb index 4e45749f..ca9aab67 100644 --- a/db/migrate/20130702113610_update_group_order_totals.rb +++ b/db/migrate/20130702113610_update_group_order_totals.rb @@ -1,10 +1,16 @@ class UpdateGroupOrderTotals < ActiveRecord::Migration def self.up - # The group_order total was updated to the total ordered amount instead of - # the amount received. Now this is fixed, the totals need to be updated. - GroupOrder.all.each do |go| - go.order.closed? and go.update_price! - end + say "If you have ever modified an order after it was settled, the group_order's " + + "price may be calculated incorrectly. This can take a lot of time on a " + + "large database." + + 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 def self.down