Rails find all with association

Posted by aaronrussell on Stack Overflow See other posts from Stack Overflow or by aaronrussell
Published on 2010-05-05T11:16:02Z Indexed on 2010/05/05 12:08 UTC
Read the original article Hit count: 146

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 :)

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby