Re: [Rails] using multiple joins in queries

2013-03-21 Thread Rob Biedenharn
On Mar 20, 2013, at 6:04 PM, John Merlino wrote: I have this query: Report. joins(:alerts). joins(:alert_code). I think that you're looking for 'includes' rather than 'joins' for these associations. Report.includes({:alerts = :alert_code}). To use

Re: [Rails] using multiple joins in queries

2013-03-21 Thread Frederick Cheung
On Thursday, March 21, 2013 2:33:24 AM UTC, Rob Biedenharn wrote: On Mar 20, 2013, at 6:04 PM, John Merlino wrote: I have this query: Report. joins(:alerts). joins(:alert_code). I think that you're looking for 'includes' rather than

[Rails] using multiple joins in queries

2013-03-20 Thread John Merlino
I have this query: Report. joins(:alerts). joins(:alert_code). where(:unit_id = unit_id). where{time my{self.time}}. where(alert_codes.name LIKE ?, %Inside virtual fence%).