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
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.
>
>
2 matches
Mail list logo