Sha256: 8a1e4a397e6e391ffcc399aa9f2c71416f470073be637f183982e093b7ee0427
Contents?: true
Size: 543 Bytes
Versions: 16
Compression:
Stored size: 543 Bytes
Contents
class AddAmountCurrency < ActiveRecord::Migration def up rename_column :ems_registrations, :amount, :amount_paid_cents add_column :ems_registrations, :amount_paid_currency, :string Registration.unscoped.all.each do |r| Account.current = Account.find(r.account_id) r.update_attribute(:amount_paid_currency, r.workshop_price.price_currency) end end def down rename_column :ems_registrations, :amount_paid_cents, :amount remove_column :ems_registrations, :amount_paid_currency end end
Version data entries
16 entries across 16 versions & 1 rubygems