[Rails] Re: Rails Database Query

2009-08-03 Thread Robby Russell
Something along the lines of... Trail.find(:all, :include => [:trailreports], :order => ['trailreports.created_at DESC']) On Mon, Aug 3, 2009 at 12:57 PM, Nick wrote: > > Hi, > > I'm having trouble creating the right code to query the following: > > - I have a table of "trails" and a table of

[Rails] Re: Rails Database Query

2009-08-03 Thread Marnen Laibow-Koser
Nick wrote: > Hi, > > I'm having trouble creating the right code to query the following: > > - I have a table of "trails" and a table of "trailreports" > - "trails" has a "hasmany" relationship with "trailreports" > - "trailreports" has a field "trail_id", "report" and "created_at" > field. > >