Open-Source-Access-Control-.../db/migrate/20121014120609_move_card_data_to_cards.rb

12 lines
296 B
Ruby
Raw Permalink Normal View History

class MoveCardDataToCards < ActiveRecord::Migration
def up
User.all.each do |u|
u.cards.create(:id => u.card_id, :name => u.name, :card_number => u.card_number, :card_permissions => u.card_permissions)
end
end
def down
raise ActiveRecord::IrreversibleMigration
end
end