ferret,multiple model search -undefined method `aaf_index' for #<Class:>
- by jissy
ferret,multiple model search -
I have 2 models A and B.I want to perform a text search by using 3 fields; title, description(part of A) and comment(part of B). Where I want to include the comment field to perform the ferret search.Then,what other changes needed.
class A < ActiveRecord::Base
has_one :b
acts_as_ferret :fields => [:title, :description],
:additional_fields => [:comment_text]
def comment_text
return b.comment
end
In a_controller, i wrote:
@search = A.find_with_ferret(
params[:st][:text_search],
:limit => :all,
:multi => [B]
).paginate :per_page =>10, :page=>params[:page]
The second mosel is given below:
class B < ActiveRecord::Base
belongs_to :a
while using :multi[B] option with the find_with_ferret,the following error is getting:
undefined method `aaf_index' for #ClassName