Acts_as_ferret, DRb, and filter_proc

I was just trying to use acts_as_ferret with DRb and filter_proc,
without much success. My guess is that this isn’t possible because
there’s no way to send the proc to the DRb server, correct?

Person.find_by_contents(“jonathan”, :filter_proc => proc {}) causes an
exception when using DRb (DRb::DRbConnError: DRb::DRbServerNotFound).

I can work around this by applying the filter after searching as the
exact number of results isn’t too important in this case.

Cheers,
-Jonathan

On Wed, Jun 27, 2007 at 11:52:09AM +0200, Jonathan V. wrote:

I was just trying to use acts_as_ferret with DRb and filter_proc,
without much success. My guess is that this isn’t possible because
there’s no way to send the proc to the DRb server, correct?

Person.find_by_contents(“jonathan”, :filter_proc => proc {}) causes an
exception when using DRb (DRb::DRbConnError: DRb::DRbServerNotFound).

afaik acts_as_ferret has no such option. But you’re right, Procs across
DRb is not that easy, if possible at all. I don’t know what you want to
do in that proc, maybe some simple active record conditions can do what
you want?

Jens

–
Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[email protected] | www.webit.de

Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa

Yes, it’s just a filter to remove people who shouldn’t be visible so
I’ll use AR conditions.

I guess it should be possible to use a filter with DRb, perhaps by just
sending a code string that gets evaled by the DRb server.

-Jonathan.

Jens K. wrote:

afaik acts_as_ferret has no such option. But you’re right, Procs across
DRb is not that easy, if possible at all. I don’t know what you want to
do in that proc, maybe some simple active record conditions can do what
you want?