I have what I think is a very simple problem (famous last words)…
I have a Category model that has_and_belongs_to_many Events. I want to construct a simple and efficient query that finds all categories that have 1 or more events. (using Rails 3)
I’m sure I’m having a dumb moment here – any help appreciated 🙂
How about:
You could also add this as a named scope to your
Categoryclass so that you can sayCategory.with_eventse.g.