I have this relationship between categories, products & brands:
class Brand < ActiveRecord::Base has_many :products end class Cate
You did the right thing with the join, just add a more complex where definition:
Category.joins(:products).where(:products => {:brand_id => 1})