On Mon, Oct 16, 2006 at 05:41:23PM +0200, Evan wrote:
> Jens Kraemer wrote:
> > On Wed, Oct 11, 2006 at 01:11:32AM +0200, Evan wrote:
> > Don't call acts_as_ferret in your base class, instead add the :name
> > field to the acts_as_ferret calls in Music and Book. That should fix
> > your problems.
> 
> I assume that I will be unable to call Product.find_by_contents in this 
> case.  So, in order to do search of all products I would have to do a 
> multi-index search?

right.

You could also do it the other way around: just call acts_as_ferret in your 
Product class, and override to_doc in your child classes to add your dynamic 
properties to the ferret document. Don't forget to use 
:store_classname => true when you call acts_as_ferret.

If you want to declare special Ferret options on a per field level,
you'd have to declare them in the acts_as_ferret call in class Product
for all kinds of products. That's not really nice but should work.


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