Skip to content

Commit

Permalink
Merge pull request #195 from hatkirby/patch-1
Browse files Browse the repository at this point in the history
Fixed all_tag_counts crashing when using a table prefix
  • Loading branch information
Artem Kramarenko committed Dec 8, 2011
2 parents 234df00 + 7c3e081 commit 275d134
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/acts_as_taggable_on/acts_as_taggable_on/collection.rb
Expand Up @@ -125,7 +125,7 @@ def all_tag_counts(options = {})
tagging_scope = tagging_scope.group(group_by)
end

tag_scope = tag_scope.joins("JOIN (#{tagging_scope.to_sql}) AS taggings ON taggings.tag_id = tags.id")
tag_scope = tag_scope.joins("JOIN (#{tagging_scope.to_sql}) AS #{ActsAsTaggableOn::Tagging.table_name} ON #{ActsAsTaggableOn::Tagging.table_name}.tag_id = #{ActsAsTaggableOn::Tag.table_name}.id")
tag_scope
end
end
Expand Down

0 comments on commit 275d134

Please sign in to comment.