Skip to content

Commit

Permalink
Fixed behavior of all_tag_counts() when a table prefix is being used …
Browse files Browse the repository at this point in the history
…(it previously threw an ActiveRecord::StatementInvalid exception)
  • Loading branch information
hatkirby committed Oct 9, 2011
1 parent dcc0c62 commit 7c3e081
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 7c3e081

Please sign in to comment.