I have the following scope for my model:
class Cloth < ActiveRecord::Base
include Ownerable
has_many :cloth_tags, :dependent => :destroy
pg_search_scope :full_search,
associated_against: {
cloth_tags: [:name, :brand_name]
},
against: [:name, :description],
ignoring: :accents,
using: {
tsearch: {
dictionary: "spanish",
any_word: true
}
}
So if I call something like Cloth.full_search('shirt')
works fine, but if I add owner: [:name]
to the associated_against
hash, it throws NameError: uninitialized constant Cloth::Owner
. Nedless to say that the owner relationship in normal circumstances is working. In any case is defined in a module like this:
module Ownerable
extend ActiveSupport::Concern
included do
belongs_to :owner, :polymorphic => true
end
Any clue what thing could be? Thanks in advance