<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,7 @@
+== 2008-07-17
+
+* Can now use a named_scope to find tags!
+
 == 2008-06-23
 
 * Can now find related objects of another class (tristanzdunn)</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -76,15 +76,35 @@ end
 @user.tags # =&gt; [&lt;Tag name:&quot;awesome&quot;&gt;,&lt;Tag name:&quot;slick&quot;&gt;,&lt;Tag name:&quot;hefty&quot;&gt;]
 @user.skills # =&gt; [&lt;Tag name:&quot;joking&quot;&gt;,&lt;Tag name:&quot;clowning&quot;&gt;,&lt;Tag name:&quot;boxing&quot;&gt;]
 
+# The old way
 User.find_tagged_with(&quot;awesome&quot;, :on =&gt; :tags) # =&gt; [@user]
 User.find_tagged_with(&quot;awesome&quot;, :on =&gt; :skills) # =&gt; []
 
+# The better way (utilizes named_scope)
+User.tagged_with(&quot;awesome&quot;, :on =&gt; :tags) # =&gt; [@user]
+User.tagged_with(&quot;awesome&quot;, :on =&gt; :skills) # =&gt; []
+
 @frankie = User.create(:name =&gt; &quot;Frankie&quot;, :skill_list =&gt; &quot;joking, flying, eating&quot;)
 User.skill_counts # =&gt; [&lt;Tag name=&quot;joking&quot; count=2&gt;,&lt;Tag name=&quot;clowning&quot; count=1&gt;...]
 @frankie.skill_counts
 
+Finding Tagged Objects
+======================
+
+Acts As Taggable On utilizes Rails 2.1's named_scope to create an association
+for tags. This way you can mix and match to filter down your results, and it
+also improves compatibility with the will_paginate gem:
+
+class User &lt; ActiveRecord::Base
+  acts_as_taggable_on :tags
+  named_scope :by_join_date, :order =&gt; &quot;created_at DESC&quot;
+end
+
+User.tagged_with(&quot;awesome&quot;).by_date
+User.tagged_with(&quot;awesome&quot;).by_date.paginate(:page =&gt; params[:page], :per_page =&gt; 20)
+
 Relationships
-====================
+=============
 
 You can find objects of the same type based on similar tags on certain contexts.
 Also, objects will be returned in descending order based on the total number of </diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -79,6 +79,12 @@ module ActiveRecord
             
               before_save :save_cached_tag_list
               after_save :save_tags
+              
+              if respond_to?(:named_scope)
+                named_scope :tagged_with, lambda{ |tags, options|
+                  find_options_for_find_tagged_with(tags, options)
+                }
+              end
             end
             
             include ActiveRecord::Acts::TaggableOn::InstanceMethods</diff>
      <filename>lib/acts_as_taggable_on/acts_as_taggable_on.rb</filename>
    </modified>
    <modified>
      <diff>@@ -56,6 +56,15 @@ describe &quot;Taggable&quot; do
     TaggableModel.find_tagged_with(&quot;bob&quot;, :on =&gt; :tags).first.should == @taggable
   end
   
+  it &quot;should be able to use the tagged_with named scope&quot; do
+    @taggable.skill_list = &quot;ruby, rails, css&quot;
+    @taggable.tag_list = &quot;bob, charlie&quot;
+    @taggable.save
+    TaggableModel.tagged_with(&quot;ruby&quot;, {}).first.should == @taggable
+    TaggableModel.tagged_with(&quot;bob&quot;, :on =&gt; :skills).first.should_not == @taggable
+    TaggableModel.tagged_with(&quot;bob&quot;, :on =&gt; :tags).first.should == @taggable
+  end
+  
   it &quot;should not care about case&quot; do
     bob = TaggableModel.create(:name =&gt; &quot;Bob&quot;, :tag_list =&gt; &quot;ruby&quot;)
     frank = TaggableModel.create(:name =&gt; &quot;Frank&quot;, :tag_list =&gt; &quot;Ruby&quot;)</diff>
      <filename>spec/acts_as_taggable_on/taggable_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>888bab36bdadc4b579f209c527d7c7b07af2b2a8</id>
    </parent>
  </parents>
  <author>
    <name>Michael Bleigh</name>
    <email>michael@intridea.com</email>
  </author>
  <url>http://github.com/mbleigh/acts-as-taggable-on/commit/77f3e951162d39a2c57788d6a8bdb4f48680e4d1</url>
  <id>77f3e951162d39a2c57788d6a8bdb4f48680e4d1</id>
  <committed-date>2008-07-17T12:33:48-07:00</committed-date>
  <authored-date>2008-07-17T12:33:48-07:00</authored-date>
  <message>Added the 'tagged_with' named_scope for total awesomeness.</message>
  <tree>c9bf9f14a66061858581de23b463b512ba7fb189</tree>
  <committer>
    <name>Michael Bleigh</name>
    <email>michael@intridea.com</email>
  </committer>
</commit>
