mbleigh/acts-as-taggable-on — Issue #200: all_tag_counts sql not compatible with oracle (ORA-00905) missing keyword error
Author: jhanzel
Created: 2011-10-28 18:33:58+00:00
State: open

Using rails 3.0.9 using acs-as-taggable-on 2.1.1

When you try to do a Document.all_tag_counts or document.all_tag_counts, you get missing keywords: SELECT tags.*, taggings.count AS count FROM "TAGS" join (SELECT taggings.tag_id, COUNT(taggings.tag_id) AS tags_count FROM "TAGGINGS" INNER JOIN documents ON documents.id = taggings.taggable_id WHERE (taggings.taggable_type = 'Document' AND (taggings.taggable_id (SELECT documents.id FROM DOCUMENTS")) GROUP BY taggings.tag_id HAVING COUNT(taggings.tag_id) > 0) AS taggings ON taggings.tag_id = tags.id

While the sql is logically correct, it is not valid syntax from oracle :(

If I back down to version 2.0.6 of the gem, this is no longer a problem.