Fix failing migration for new price and currency columns of ticket
This commit is contained in:
parent
fa5b5242c1
commit
0911e1ed83
1 changed files with 11 additions and 9 deletions
|
|
@ -9,6 +9,7 @@ class SplitTicketPriceInPriceAndCurrency < ActiveRecord::Migration
|
||||||
|
|
||||||
TempTicket.all.each do |ticket|
|
TempTicket.all.each do |ticket|
|
||||||
# Replace currency symbol with ISO Code
|
# Replace currency symbol with ISO Code
|
||||||
|
if ticket.ticket_price
|
||||||
ticket.ticket_price.gsub!('€', 'EUR')
|
ticket.ticket_price.gsub!('€', 'EUR')
|
||||||
ticket.ticket_price.gsub!('$', 'USD')
|
ticket.ticket_price.gsub!('$', 'USD')
|
||||||
ticket.ticket_price.gsub!('£', 'GBP')
|
ticket.ticket_price.gsub!('£', 'GBP')
|
||||||
|
|
@ -20,6 +21,7 @@ class SplitTicketPriceInPriceAndCurrency < ActiveRecord::Migration
|
||||||
ticket.price_currency = money.currency_as_string
|
ticket.price_currency = money.currency_as_string
|
||||||
ticket.save
|
ticket.save
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
remove_column :tickets, :ticket_price
|
remove_column :tickets, :ticket_price
|
||||||
remove_column :tickets, :url
|
remove_column :tickets, :url
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue