mbleigh/acts-as-taggable-on — pull request #223 by unindented (2012-01-25 16:10:57+00:00)
Title: Tag ownership and STI

Tag ownership was failing when the owner was a subclass.

It inserted the tagging correctly, using the base class of the owner:

INSERT INTO "taggings" ("context", "created_at", "tag_id", "taggable_id", "taggable_type", "tagger_id", "tagger_type") VALUES (?, ?, ?, ?, ?, ?, ?)[0m [["context", "tags"], ["created_at", 2012-01-25 15:33:52 UTC], ["tag_id", 274], ["taggable_id", 131], ["taggable_type", "TaggableModel"], ["tagger_id", 25], ["tagger_type", "TaggableUser"]]

But then it queried incorrectly, using the class of the owner instead of the base class:

SELECT "tags".* FROM "tags" INNER JOIN "taggings" ON "tags"."id" = "taggings"."tag_id" WHERE "taggings"."taggable_id" = 131 AND "taggings"."taggable_type" = 'TaggableModel' AND (taggings.context = 'tags' AND taggings.tagger_id = 25 AND taggings.tagger_type = 'InheritingTaggableUser')