Displaying 1 result from an estimated 1 matches for "adddeliidtomenuitem".
2008 Oct 07
0
associations not saved in migration
...update them via the migration but my items don''t save. i''ve
used save! in 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....