Thanks Nicolas, It works perfectly!
Il giorno 02/mag/06, alle ore 14:43, Nicolas Buet ha scritto:
> That should do:
>
> Projects.find(:all, :include => ''works'', :order =>
''works.year_start'')
>
> Regards,
>
> Nicolas
>
> On 5/2/06, Ettore Berardi <ettober@telvia.it> wrote:
> Hi!
> I''ve two models:
> Project has_many :works
> Work belongs_to :project
>
> Work contains :year_start and :year_end
>
> I''ve setup a class method to retrieve the first and last year of
my
> Project.works
>
> How could I get projects ordered by ''first'' year?
>
> Thanks,
> Ettore
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060502/ec57933d/attachment.html