Bugs: Browse | Submit New | Admin

[#12787] when calling #search on an association, the #find fails

Date:
2007-08-02 19:59
Priority:
3
Submitted By:
Michael Nutt (mnutt)
Assigned To:
Eric Hodel (drbrain)
Category:
Sphincter
State:
Open
Summary:
when calling #search on an association, the #find fails

Detailed description
If Post is indexed and App has_many posts, when I call @app.posts.search(...) without conditions it will fail if sphinx
returns posts with a different app_id.

Sphincter calls "find ids" on the results, and that #find is wrapped by with_conditions that will sometimes
filter out posts, so the error message that you get back is "Couldn't find Post with ID=X" where X actually
exists.

If you think it's worth automatically adding the conditions to the sphinx filter or returning a more informative error
message I can submit a patch.

Add A Comment: Notepad

Please login


Followup

Message
Date: 2007-08-05 20:13
Sender: Michael Nutt

Unfortunately sphinx's ruby bindings only support filter
conditions with numeric values, so I think that
automatically adding an association's scope would be a bad
idea.  I don't think it's worth the trouble until sphinx's
ruby api is fixed.
Date: 2007-08-03 02:14
Sender: Eric Hodel

I think its worth automatically adding the conditions to sphinx's
filter.  Can you submit a patch?  Or some example code that fails,
if you don't want to.

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

Field Old Value Date By
resolution_idNone2007-08-03 02:14drbrain