activerecord and counting

Binh Ly
2008-01-11T20:34:13Z

hello all,

so i have the following situation

company has_many products
products has many parts

i can do company.products .count and get back the product count

what i''d like to know is if there is a more elegant way to get the
number of parts for a given company outside of iterating through each
product, counting its parts and then summing that number.

the solution i have now works.  i was just wondering if there was a more
elegant way of going about it.

thanks,

binh