11175
(-- --)
August 20, 2008, 3: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
_Wolas
("Wolas!")
August 20, 2008, 10:30am
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.
11175
(-- --)
August 20, 2008, 1:21pm
3
you are a geeeeeennnniiiiiuuusss... i've just been going the wrong
direction.