Yes, but include what? A better way might be to leverage the new  
(well, fairly new - was it in 2.2?) syntax for accessing fields of  
join tables. So the example below would be:

set_default_order :custodian => :name

--Matt Jones

On May 29, 2009, at 6:27 PM, Owen wrote:

>
> I think that is a good idea.  Others?
>
>
> -Owen
>
> On May 27, 5:06 pm, Montgomery Kosma <[email protected]> wrote:
>> I have Collection object which belongs_to Custodian.  I'd like my
>> Collections to be grouped or ordered by custodian.name.
>>
>> In vanilla rails, this works:
>>
>> Collection.all(:include => :custodian, :order => "custodians.name")
>>
>> Absent the :include option, I get an "unknown column
>> custodians.name"  (not sure why custodians has to be plural ...).
>>
>> I get the same error in Hobo if I my Collection class specifies:
>>
>> set_default_order "custodians.name"
>>
>> I think the fix is to add the :include option to the default find
>> behavior.  Any way in Hobo to do that?  If not, should there be?
> >


--~--~---------~--~----~------------~-------~--~----~
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