For several hours I have been unsuccessfully trying to use the areas of the sphinxes.
I want to use ActsAsTaggableOn scope tags. In my model (i.e. taggable), I tried the following areas:
scope :tagged, lambda {
joins(:taggings => :tag).
where("tags.name = 'consequatur'")
}
sphinx_scope :tagged do
joins(:taggings => :tag).
where("tags.name = 'consequatur'")
end
Another try with old conditions:
scope :tagged, :joins => :taggings, :conditions => {"taggings.tag_id" => 74}
sphinx_scope(:tagged) do
{:joins => :taggings, :conditions => {"taggings.tag_id" => 74}}
end
How can I make these areas work? Is there any other way to archive this task? I only want to search for models that are tagged with a specific tag.
source
share