From: Hans F. <fu...@us...> - 2004-06-29 14:24:16
|
Update of /cvsroot/neelix/neelix/presenter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29132/presenter Modified Files: presenter.rb Log Message: Delete now works, if you're running an up-to-date cvs tree of qtruby. The trick is the i.dispose call. If you have an older qtruby, it will do the delete in the db before crashing. Index: presenter.rb =================================================================== RCS file: /cvsroot/neelix/neelix/presenter/presenter.rb,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- presenter.rb 25 Jun 2004 02:45:31 -0000 1.6 +++ presenter.rb 29 Jun 2004 14:24:07 -0000 1.7 @@ -33,6 +33,25 @@ f = $replicator.create('food',{'name'=>text}) if not f f end + + # Delete the given cookbook. + def Presenter::deleteCookbook(cookbook) + $replicator.cookbooks.delete(cookbook) + end + + # TODO The following two functions don't actually remove things from the + # database. They just remove associations. After prolonged use the database + # will be full of cruft. We can handle this with a vacuum or do something + # smarter here eventually. + + # Delete the given category from the given cookbook. + def Presenter::deleteCategory(cookbook,category) + cookbook.categories.delete(category) + end + # Delete the given recipe from the given category. + def Presenter::deleteRecipe(category,recipe) + category.recipes.delete(recipe) + end end # vim:ts=8:sw=2:nowrap |