morgan
August 20, 2008, 5:34am
1
So i have and object with an attribute that contains a bunch more
attributes.
i would like to sort the schedules by the sched_timestart field which is
a datetime stamp
user-
—name
|
—schedules
|---- sched_timestart
|---- sched_timestart
|---- sched_timestart
|---- sched_timestart
|---- sched_timestart
|---- sched_timestart
user-
—name
|
—schedules
|---- sched_timestart
|---- sched_timestart
|---- sched_timestart
|---- sched_timestart
|---- sched_timestart
|---- sched_timestart
morgan
August 20, 2008, 12:31pm
2
So i have and object with an attribute that contains a bunch more
attributes.
do you mean a many-to-many relation? I.e:
class User < AR::Base
has_many :schedules
end
if so, heres how you order:
class User < AR::Base
has_many :schedules, :order => ‘shed_timestart ASC’
end
ASC can be replaced by DESC. ASC is ascending (biggest at top,
smallest at bottom), DESC is descending.
On Aug 20, 4:34 am, Morgan M. [email protected]
morgan
August 20, 2008, 3:21pm
3
you are a geeeeeennnniiiiiuuusss… i’ve just been going the wrong
direction.