logo       

Re: easy question, how would i search a grandparent???!: msg#00084

lang.ruby.ferret.general

Subject: Re: easy question, how would i search a grandparent???!

Hello Jens thanks for the help, however something is still not quite
right with my code.

my view
Howto.find_by_contents("#{srchstring} +main_category:#{category}")


howto class
belongs_to :scategory
acts_as_ferret :field=>["title", "setup", :main_category]

def main_category
scategory.mcategory.name
end



when i did a manual 'get a howto' object and executed the function
main_category on it, the main category was returned correctly. i think
right now, the problem is the :main_category is not getting indexed.
whats odd is that on my console print out screen, all the attributes for
my model howto are getting indexed, not just the ones i specify. is this
correct?

this is what gets printed out to the console, i dont see anything for
:main_category.

creating doc for class: Howto, id: 1
Adding field linktosite with value 'none' to index
Adding field user_id with value '1' to index
Adding field title with value 'how to cook a steak chips' to index
Adding field created_at with value 'Tue Dec 12 00:00:00 EST 2006' to
index
Adding field scategory_id with value '1' to index
Adding field setup with value 'pan, oil, salt, etc...' to index
Adding field howto with value 'boisdv oios oisdj vojv ojsdo voisjdv oij
oisdvoi jv joi dsjvio jsvdoi j' to index


my problem must be really silly.

--
Posted via http://www.ruby-forum.com/.


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise