Sha256: 2d7685427d67531c310a288f3d110cc534d636c40247f741c04508df1e8f6446

Contents?: true

Size: 435 Bytes

Versions: 12

Compression:

Stored size: 435 Bytes

Contents

class AddTotalPaidToMembership < ActiveRecord::Migration
  def change
    add_column :memberships, :cart_price, :integer
    add_column :memberships, :total_paid, :integer
    add_column :memberships, :changed_membership_id, :integer, :defult => nil

    Membership.all.each do |membership|
      membership.cart_price = membership.sold_price
      membership.total_paid = membership.sold_price
      membership.save
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
artfully_ose-1.3.0.pre4 db/migrate/20140314162422_add_total_paid_to_membership.rb
artfully_ose-1.3.0.pre3 db/migrate/20140314162422_add_total_paid_to_membership.rb
artfully_ose-1.3.0.pre2 db/migrate/20140314162422_add_total_paid_to_membership.rb
artfully_ose-1.3.0.pre1 db/migrate/20140314162422_add_total_paid_to_membership.rb
artfully_ose-1.2.0 db/migrate/20140314162422_add_total_paid_to_membership.rb
artfully_ose-1.2.0.beta.1 db/migrate/20140314162422_add_total_paid_to_membership.rb
artfully_ose-1.2.0.alpha.2 db/migrate/20140314162422_add_total_paid_to_membership.rb
artfully_ose-1.2.0.alpha.1 db/migrate/20140314162422_add_total_paid_to_membership.rb
artfully_ose-1.2.0.pre.27 db/migrate/20140314162422_add_total_paid_to_membership.rb
artfully_ose-1.2.0.pre.26 db/migrate/20140314162422_add_total_paid_to_membership.rb
artfully_ose-1.2.0.pre.24 db/migrate/20140314162422_add_total_paid_to_membership.rb
artfully_ose-1.2.0.pre.23 db/migrate/20140314162422_add_total_paid_to_membership.rb