Somewhere the ordering of objects retrieved from the database with
eagerly loaded associations is messed up. I have an object where I
eagerly load two associations. The database (PgSQL 8.0.1) returns them
correctly as specified by the "order by" clause. But in my list view
they appear in some arbitrary order.
My understanding is that the cause of this misbehavior lies in
ActiveRecord::Associations#find_with_associations. There the
instantiated "main" objects are stored in a hash and the values from
this hash are returned. Now the problem is that the hash doesn''t
maintain the order in which the objects (records) were originally
returned from the database, thus objects are returned in the an
incorrect order.
Michael
--
Michael Schuerig Most people would rather die than think.
mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org
In fact, they do.
http://www.schuerig.de/michael/ --Bertrand Russell