On Mar 4, 10:29 am, Johannes Vanderknyff
<[email protected]> wrote:
> Bryan,
>
> Thank you. That makes sense, I was wondering why an array of models
> converted to another array of models wouldn't work.  I did figure out that
> any "find" statement would work. However, what I need to do is create a
> subset of my model and then sort it and I can't seem to figure out how to
> keep that "association"

You can use named_scope or (find :conditions) to get your subset.

For ordering, you can use the :order option on your has_many.  Note
that you can have more than one has_many that are essentially the same
except for :order.

has_many :comments, :order => :created_at
has_many :comments_by_auther, :order => :auther, :class_name =>
"Comment"

Bryan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to