Forum: Ferret acts_as_ferret, DRb, and filter_proc

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Jonathan V. (Guest)
on 2007-06-27 13:52
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
Jens K. (Guest)
on 2007-06-27 14:20
(Received via mailing list)
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
removed_email_address@domain.invalid | www.webit.de

Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa
Jonathan V. (Guest)
on 2007-06-27 14:26
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?
>
This topic is locked and can not be replied to.