Active record/query condition based on a related model attribute...

I missed that bit in the guide. Of course it works now ;)

Thanks Horacio