Permalink
Browse files

Use the base class of the owner to query

  • Loading branch information...
1 parent dcdb931 commit 35852b6f8cf47ec3259197550114be60a9df7d4c @unindented unindented committed Jan 25, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/acts_as_taggable_on/acts_as_taggable_on/ownership.rb
@@ -35,7 +35,7 @@ def owner_tags_on(owner, context)
else
scope = base_tags.where([%(#{ActsAsTaggableOn::Tagging.table_name}.context = ? AND
#{ActsAsTaggableOn::Tagging.table_name}.tagger_id = ? AND
- #{ActsAsTaggableOn::Tagging.table_name}.tagger_type = ?), context.to_s, owner.id, owner.class.to_s])
+ #{ActsAsTaggableOn::Tagging.table_name}.tagger_type = ?), context.to_s, owner.id, owner.class.base_class.to_s])
end
# when preserving tag order, return tags in created order
# if we added the order to the association this would always apply
@@ -103,7 +103,7 @@ def save_owned_tags
# have the correct context, and are removed from the list.
if old_tags.present?
old_taggings = ActsAsTaggableOn::Tagging.where(:taggable_id => id, :taggable_type => self.class.base_class.to_s,
- :tagger_type => owner.class.to_s, :tagger_id => owner.id,
+ :tagger_type => owner.class.base_class.to_s, :tagger_id => owner.id,
:tag_id => old_tags, :context => context).all
end
@@ -123,4 +123,4 @@ def save_owned_tags
end
end
end
-end
+end

0 comments on commit 35852b6

Please sign in to comment.