Forum: Ruby on Rails acts_as_taggable Generating Funky SQL

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
HH (Guest)
on 2006-02-09 07:37
(Received via mailing list)
I am using acts_as_taggable in my application and on the tagging side of
things, no problem at all. Running edge Rails and PostgreSQL 8.1.

I am then trying to find all my AR objects with a certain tag. The tag
lasvegas and I know that there are at least 3 records with that tag.

So, I'm doing this:

@lists = List.find_tagged_with :any => @search_string, :separator => '+'

The problem is that the SQL generated looks like this:

SELECT lists.* FROM lists, tags, taggings WHERE =
taggings.taggable_id AND taggings.taggable_type = 'List' AND
= AND IN ('anylasvegas', 'separator+')

See what's right after the IN clause? It says 'anylasvegas' - why? BTW,
using 'lasvegas' returns the correct results.

I used the :any symbol in the finder per the instructions and all the
permutations I tried to get rid of it just gave me syntax errors, etc...

So, am I doing something wrong or what?

This topic is locked and can not be replied to.