<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -170,16 +170,18 @@ module ActiveRecord
         #  :at_most - Exclude tags with a frequency greater than the given value
         #  :on - Scope the find to only include a certain context
         def find_options_for_tag_counts(options = {})
-          options.assert_valid_keys :start_at, :end_at, :conditions, :at_least, :at_most, :order, :limit, :on
+          options.assert_valid_keys :start_at, :end_at, :conditions, :at_least, :at_most, :order, :limit, :on, :id
           
           scope = scope(:find)
           start_at = sanitize_sql([&quot;#{Tagging.table_name}.created_at &gt;= ?&quot;, options.delete(:start_at)]) if options[:start_at]
           end_at = sanitize_sql([&quot;#{Tagging.table_name}.created_at &lt;= ?&quot;, options.delete(:end_at)]) if options[:end_at]
 
-          type_and_context = &quot;#{Tagging.table_name}.taggable_type = #{quote_value(base_class.name)}&quot;
+          taggable_type = sanitize_sql([&quot;#{Tagging.table_name}.taggable_type = ?&quot;, base_class.name])
+          taggable_id = sanitize_sql([&quot;#{Tagging.table_name}.taggable_id = ?&quot;, options.delete(:id)]) if options[:id]
           
           conditions = [
-            type_and_context,
+            taggable_type,
+            taggable_id,
             options[:conditions],
             start_at,
             end_at
@@ -203,7 +205,7 @@ module ActiveRecord
             :joins      =&gt; joins.join(&quot; &quot;),
             :conditions =&gt; conditions,
             :group      =&gt; group_by
-          }.update(options)
+          }
         end    
         
         def is_taggable?
@@ -260,8 +262,8 @@ module ActiveRecord
           add_custom_context(context)
         end
         
-        def tag_counts_on(context,options={})
-          self.class.tag_counts_on(context,{:conditions =&gt; [&quot;#{Tag.table_name}.name IN (?)&quot;, tag_list_on(context)]}.reverse_merge!(options))
+        def tag_counts_on(context, options={})
+          self.class.tag_counts_on(context, options.merge(:id =&gt; self.id))
         end
 
         def related_tags_for(context, klass, options = {})
@@ -321,4 +323,4 @@ module ActiveRecord
       end
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>lib/acts_as_taggable_on/acts_as_taggable_on.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b1ce354f07d701c48b8f01ca3827c2768b87f3cd</id>
    </parent>
  </parents>
  <author>
    <name>Marcello Barnaba</name>
    <email>vjt@openssl.it</email>
  </author>
  <url>http://github.com/mbleigh/acts-as-taggable-on/commit/7c2d3763a3a7b86bb240ff659f09a70977adc74f</url>
  <id>7c2d3763a3a7b86bb240ff659f09a70977adc74f</id>
  <committed-date>2009-03-26T08:46:39-07:00</committed-date>
  <authored-date>2009-03-15T19:43:54-07:00</authored-date>
  <message>When calling .tag_counts on an instance, count only the taggings associated to that specific instance

Signed-off-by: Michael Bleigh &lt;michael@intridea.com&gt;</message>
  <tree>a0ca25a72a1c9e4252c3a390766efc3cf494633d</tree>
  <committer>
    <name>Michael Bleigh</name>
    <email>michael@intridea.com</email>
  </committer>
</commit>
