I would like to have a named_scope for blogs with zero posts.
The following does not work.
class Post < ActiveRecord::Base
belongs_to :blog
end
class Blog < ActiveRecord::Base
has_many :posts
named_scope :has_no_posts, :conditions => "blogs.id NOT IN (SELECT blog_id FROM posts)"
end