Active record always appending "order by created_at desc"

James Kebinger wrote:

I'm doing a find all and adding my own :order option, but whatever I
add, AR still adds another "created_at desc" to the end of the order
list. This is causing the query to blow up when created_at is ambiguous.

This is the query:
@user.notes.find(:all, :include =>
[:project],:order=>"notes.created_at").each do |note|

and the sql ends up like this:
...
WHERE (notes.user_id = 1) ORDER BY notes.created_at, created_at DESC)

Does the declaration of the notes association in the Order model
have a :order option?

James wrote:

Thanks for replying. I believe it does. Is there a way to deactivate or override that ordering for the purpose of this query?

The most simple way would be to declare another identical
but unordered association.

But if you really want to have one association and to leave
the default order option in place, you should be able to do use
reflect_on_association to change the order option, then change it
back. See:

http://groups.google.com/group/rubyonrails-talk/msg/06a1f5da4203a11d