1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-05 16:24:21 +01:00
fab-manager/db/migrate/20140610153123_add_stp_customer_id_to_users.rb

15 lines
311 B
Ruby
Raw Normal View History

2016-03-23 18:39:41 +01:00
class AddStpCustomerIdToUsers < ActiveRecord::Migration
def up
add_column :users, :stp_customer_id, :string
User.all.each do |user|
if user.stp_customer_id.blank?
user.send(:create_stripe_customer)
end
end
end
def down
remove_column :users, :stp_customer_id
end
end