I have a User model that has_many :posts. If I wanted to make a named_scope for finding users with at least one post would this be correct?
named_scope :at_least_one_post, :joins => :posts, :group => "users.id"
or should I take it a step further and do
named_scope :at_least_one_post, :joins => :posts, :group => "users.id", :having => "COUNT(posts.id) > 0"