On Wed, Nov 29, 2006 at 01:55:12AM +0100, Carlos Kozuszko wrote:
> I want to do the same in my app. Is there a way to do this without 
> hacking the plugin code?

not a nice one, but using the disable_ferret method you could build a
custom save method that disables ferret for the next save if some 
condition is met, and then saves the record:

def conditional_ferret_save
  disable_ferret if do_not_index? 
  save
end

note that the disable_ferret method disables indexing for this record 
for the next call to save - this is definitely not thread safe, but in 
a Rails context this usually is not a problem.

However I like the idea of having an :if option to acts_as_ferret to
specify a condition (symbol pointing to a method, or a proc) telling
whether indexing should take place or not.

Jens

-- 
webit! Gesellschaft für neue Medien mbH          www.webit.de
Dipl.-Wirtschaftsingenieur Jens Krämer       [EMAIL PROTECTED]
Schnorrstraße 76                         Tel +49 351 46766  0
D-01069 Dresden                          Fax +49 351 46766 66
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to