Displaying 1 result from an estimated 1 matches for "deli_id".
Did you mean:
dai_id
2008 Oct 07
0
associations not saved in migration
...the hopes that an exception gets raised but no luck. the
migrations run without errors but the data isn''t in the db. can anyone
point out what i might be doing wrong? thanks! code below.
class AddDeliIdToMenuItem < ActiveRecord::Migration
def self.up
add_column :menu_items, :deli_id, :integer
# todo - the code below doesn''t work, wtf?
deli = Deli.find(:first)
items = MenuItem.find(:all)
for item in items do
item.deli = deli
item.save!
end
end
def self.down
remove_column :menu_items, :deli_id
end
end
class CreateTestMenuItem...