mirror of https://github.com/fspc/BikeShed-1.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
293 B
10 lines
293 B
class AddModelToBike < ActiveRecord::Migration
|
|
def change
|
|
add_column :bikes, :model, :string
|
|
change_column :bikes, :bike_model_id, :integer, :null => true
|
|
Bike.all.each do |bike|
|
|
bike.model = BikeModel.find_by_id(bike.bike_model_id).model
|
|
bike.save
|
|
end
|
|
end
|
|
end
|
|
|