I have a members and a projects table. They are associated via a
has_many
:through. I want to find out how many members are interested in a
specific
project. All I could come up with was:
a = Project.find(:first, :include => :members, :conditions =>
“projects.name=‘my project’”).members.size
Actually, the problem is more complex than this simple example. I want
to
find count of members interested in a specific project grouped by date
and
filtered by a specific date range.
Is there a calculations magical way to do this or is it strictly
find_by_sql?
Thanks,
steve
View this message in context:
http://www.nabble.com/HMT%3A-Count-Associated-Items-tf2786928.html#a7775495
Sent from the RubyOnRails Users mailing list archive at Nabble.com.