From: Hans F. <fu...@us...> - 2004-07-02 17:39:37
|
Update of /cvsroot/neelix/neelix/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25218/model Modified Files: model.rb Log Message: Everything seems to be working with one exception. There's a bug regarding moving ingredients that I haven't pinned down yet. Sometimes the ingredient goes off into limbo (in the db, but not on screen, so you have to restart), but other times it doesn't. Once that bug is fixed, we're ready to clean up and package it 0.1.0! Index: model.rb =================================================================== RCS file: /cvsroot/neelix/neelix/model/model.rb,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- model.rb 2 Jul 2004 00:25:58 -0000 1.14 +++ model.rb 2 Jul 2004 17:39:27 -0000 1.15 @@ -271,6 +271,11 @@ (old_ingredients - @ingredients).each do |ingredient| @dbh.do("update ingredient set recipe_id=? where ingredient_id=?", nil, ingredient.id) end + + # fix ordering + @ingredients.each_with_index do |ingredient,index| + ingredient.position = index + end } @ingredients.each { |i| i.add_observer { @ingredients.notify_observers } } end |