Sha256: 1d543d961550ccb05399354d3d9a507df7261219d8ed98d38499ce32882488f5
Contents?: true
Size: 472 Bytes
Versions: 13
Compression:
Stored size: 472 Bytes
Contents
class AddEmailToOrder < ActiveRecord::Migration def self.up change_table :orders do |t| t.string :email end Order.reset_column_information # update legacy orders Order.find(:all, :include => :user, :conditions => "checkout_complete IS NOT NULL").each do |order| order.email = order.user.email order.save end end def self.down change_table :orders do |t| t.remove :email end end end
Version data entries
13 entries across 13 versions & 3 rubygems