I have a table hierarchy like so:
I’d like to be able to do this in templates:
<% for comment in @site.comments.find(:all, order=>‘timestamp desc’) %>
I’ve tried all the various permutations of ‘has_many’ in site.rb I can
think of, but can’t get it to work. I’m not even sure if ‘:include’ does
anything - I thought it was supposed to cause a join, but the query log
shows just ‘comments’ being queried. Anybody figured out how to do this?
(Besides adding ‘site_id’ to ‘comments’.)