From 507010172f88f7af7b82f4ee2b147b2fa59c656b Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Sat, 18 Oct 2014 21:26:55 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20payed=E2=86=92payed=20column=20rename=20m?= =?UTF-8?q?igration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stoptime.rb | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/stoptime.rb b/stoptime.rb index 57edf2b..84d678e 100644 --- a/stoptime.rb +++ b/stoptime.rb @@ -626,21 +626,11 @@ module StopTime::Models class PaidFlagTypoFix < V 1.9 # :nodoc: def self.up - add_column(Invoice.table_name, :paid, :boolean) - Invoice.all.each do |i| - i.paid = i.payed unless i.payed.blank? - i.save - end - remove_column(Invoice.table_name, :payed) + rename_column(Invoice.table_name, :payed, :paid) end def self.down - add_column(Invoice.table_name, :payed, :boolean) - Invoice.all.each do |i| - i.payed = i.paid unless i.paid.blank? - i.save - end - remove_column(Invoice.table_name, :paid) + rename_column(Invoice.table_name, :paid, :payed) end end