mbleigh/acts-as-taggable-on — Issue #237: column "tags_count" does not exist
Author: yaghmr
Created: 2012-03-07 14:19:02+00:00
State: open

I'm using acts-as-taggable-on at version 2.2.2 for a Rails 3.2.2 application.
In locale, in development with sqlite3 mode all work fine, but on heroku in staging mode with postgresql I have this error:

ActiveRecord::StatementInvalid: PG::Error: ERROR: column "tags_count" does not exist LINE 1: SELECT tags.*, taggings.tags_count AS count FROM "tags" JOIN (SELECT taggings.tag_id, COUNT(taggings.tag_id) AS tags_count FROM "taggings" INNER JOIN bookmarks ON bookmarks.id = taggings.taggable_id WHERE (taggings.taggable_type = 'Bookmark' AND taggings.context = 'tags') AND (taggings.taggable_id IN(SELECT bookmarks.id FROM "bookmarks" WHERE "bookmarks"."locale" = 'en' AND (private = 'f'))) GROUP BY taggings.tag_id HAVING COUNT(taggings.tag_id) > 0 AND tags_count >= 1) AS taggings ON taggings.tag_id = tags.id ORDER BY COUNT desc LIMIT 30