well i have the following...
has_many :published_links, { :order => ''lower(name)'',
:class_name =>
''Link'', :conditions => ''publish = true'' }
that does ordering via an association...
Belorion wrote:
>Is it possible to do an ordering when accessing via an association?
>
>For example, I have a habtm between Foo and Bar. I want to do
>something like this:
>
>foo = Foo.find( 1 )
>bar_list = foo.bars( :order => "created_on" )
>
>But the above doesn''t work. Is there another way to accomplish
this?
>Or will I have to do a:
>
>bar_list.sort!{ |x,y| x.created_on <=> y.created_on }
>
>Thanks.
>
>Matt
>_______________________________________________
>Rails mailing list
>Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
>http://lists.rubyonrails.org/mailman/listinfo/rails
>
>
>
>
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails