mirror of
https://github.com/fspc/BikeShed-1.git
synced 2025-02-28 16:53:23 -05:00
10 lines
299 B
Ruby
10 lines
299 B
Ruby
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.update_attribute(:model, BikeModel.find_by_id(bike['bike_model_id']).model )
|
|
end
|
|
end
|
|
end
|