On May 10, 2011, at 6:24 PM, Donald R. Ziesig wrote:
> Hi Tiago,
>
> hobo_index Document.all.map { |d| d.review_required? }
>
> undefined method `default_order' for #<Array:0xb38ca844>
>
> I think this was the same error I got during one of the iterations where I
> manually filtered the output of Document.find(:all) into an array.
>
> Don Z.
The issue is in find_or_paginate - it's trying to figure out what order to sort
the results in and breaking as a result. We should probably check
responds_to?(:default_order) in there.
For now, you're probably better off just setting 'this' explicitly - hobo_index
isn't doing much else for you:
def some_method
self.this = ...build an arbitrary collection...
end
If you're using table-plus, you'll also want to give the array the ability to
respond to member_class, or you'll get more errors:
def some_method
ary = ...build an arbitrary collection...
def ary.member_class
SomeObject
end
self.this = ary
end
--Matt Jones
--
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.