Recipes has many flavors
Flavor belongs_to Recipe
How would I find and list all recipes that do not have any associated
I am running a nightly report that is looking for all recipes which
missing flavors to let the user know that they neeed to create some
flavors for those recipes.
The sql you need is left outer join, ie something like
Recipe.find :all, :joins => 'left outer join flavours on recipe_id =
:conditions => 'flavours.id is null',
:select => 'recipes.*'
(the :select clause is unneeded on rails 2.0 - rails adds it for you)