On Mon, Oct 01, 2007 at 06:37:05AM +0200, Dave Munson wrote:
> I've read the Rails Envy AAF tutorial at
> http://railsenvy.com/2007/2/19/acts-as-ferret-tutorial and its given me
> some really good ideas.
> 
> My problem lies in having AAF search the target Model's child tables.
> 
> I have no problem at all doing something like:
>     acts_as_ferret :fields => [:title, :update_collection, :member_name]
> 
>     def member_name
>         return "#{self.member.username}"
>     end
> 
> However when I try to query child tables like such...
>     def update_collection
>         self.place_updates.collect { |update| update.description }.join
> ' '
>     end
> I have no luck.
> 
> I know the method is working because if I do something like
> 
> raise Model.find(5).update_collection.inspect it returns a string with
> all descriptions.
> 
> Any ideas? I would really appreciate any help!

most probably the collection isn't there yet when aaf indexes your
record. Have a look at your log file to see what value aaf gets from
your method when it calls it.

cheers,
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
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to