Forum: Ruby on Rails issues with searching custom fields with acts_as_ferret

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.
997433f165140d58f52b8c0d1d005dc1?d=identicon&s=25 Patrick Aljord (Guest)
on 2007-05-23 22:42
(Received via mailing list)
Hey all,

I'm using acts_as_ferret this way:
class Job < ActiveRecord::Base
acts_as_ferret :fields => [:title, :workers_name]

def workers_name
return self.workers.inject("") {|names,b| names + " " +
b.first_name}.to_s
end
end

But when I do Job.find_by_contents("workers_name:patrick")
I get nil.

Yet when I do:
j=Job.find :first
j.workers_name
I do get a worker (among others) which name is patrick.

Any idea why I don't get it with find_by_contents?

thanx in advance

Pat
This topic is locked and can not be replied to.