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.

On 5/10/2011 6:16 PM, Tiago Franco wrote:
Hi Donald,

How about: Document.all.map { |d| d.review_required? }

It's not fast, but unless you can map the review_required logic into SQL, this might be the way to go.

Thanks,
  TF

On 10/5/11 11:10 PM, Donald R. Ziesig wrote:
 Hi everyone!

I have a model (Document) which presents a non-table-column attribute "review_required?". I need to be able to filter the input to hobo_index and/or table-plus such that only the records with a true value are displayed.

The review_required? attribute is a relatively complex function of the children of the Document model that would be extremely tedious and error-prone to replace with a pre-calculated table column.

What works:

hobo_index Document

and

<table-plus fields="this, review_required?" without-search-form param/>

Produces a nice list of documents

Document    Review Required
doc 1                Yes
doc 3                No
doc 4                No
doc 6                Yes

etc.

So I am sure the review_required? attribute works.

What doesn't work:

I have tried numerous ways of filtering the output of Document.

Document.find(:all, :conditions=> ... ) doesn't work because review_required is not field in the table.

Document.review_required(true) doesn't work because it doesn't recognize the method review_required (its there). I have tried many variations on this theme, including adding a second method review_required without the ?, but all fail for the same reason.

Document.apply_scopes(:review_required => true) same failure, can't find review_required. Grasping at straws here.

I used the output of Document.find(:all) to create an array of the records that meet the criterion, but hobo_index fails because the array is not a finder.

Help anyone! :-[

Don Z.

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

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