<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -41,9 +41,13 @@ module BeyondThePath
       
       # Adds class methods.
       module SingletonMethods
-        
+       
+        def friendly_identifier?(id)
+          id.is_a?(String) &amp;&amp; id.to_i.to_s != id
+        end
+
         def find(*args)
-          if args.first.is_a? String
+          if friendly_identifier? args.first
             super(:first, :conditions =&gt; [&quot;#{identifier_options[:identifier_column]} = ?&quot;, args.first])
           else
             super</diff>
      <filename>lib/friendly_identifier.rb</filename>
    </modified>
    <modified>
      <diff>@@ -63,6 +63,22 @@ class FriendlyIdentifierTest &lt; Test::Unit::TestCase
     flunk &quot;Can't find an object with a different identifier column&quot;
   end
 
+  def test_should_also_allow_object_to_be_found_by_id
+    gadget = create_gadget(:name =&gt; &quot;new name&quot;)
+    assert_not_nil gadget.url_slug
+    assert gadget.save, &quot;Couldn't save object #{gadget.errors.inspect}&quot;
+    assert_not_nil (g = Gadget.find(gadget.id)), &quot;Can't find an object by id&quot;
+    assert_equal gadget.name, g.name, &quot;Gadget we found is not the same as the one we want&quot;
+  end
+
+  def test_should_also_allow_object_to_be_found_by_string_id
+    gadget = create_gadget(:name =&gt; &quot;test name&quot;)
+    assert_not_nil gadget.url_slug
+    assert gadget.save, &quot;Couldn't save object #{gadget.errors.inspect}&quot;
+    assert_not_nil (g = Gadget.find(gadget.id.to_s)), &quot;Can't find an object by id&quot;
+    assert_equal gadget.name, g.name, &quot;Gadget we found is not the same as the one we want&quot;
+  end
+
   def test_should_not_mess_with_validations_and_after_save
     gadget = create_gadget :required_stuff =&gt; nil
     assert !gadget.valid?</diff>
      <filename>test/friendly_identifier_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a7994221a585de989911b1b7cff1c057b8b00740</id>
    </parent>
  </parents>
  <author>
    <name>Chad Pytel</name>
    <email>cpytel@thoughtbot.com</email>
  </author>
  <url>http://github.com/thoughtbot/friendly-identifier/commit/9ad4b37d3fe074bc8b2791b6ce0c0608d5ce8e8b</url>
  <id>9ad4b37d3fe074bc8b2791b6ce0c0608d5ce8e8b</id>
  <committed-date>2009-04-13T08:12:43-07:00</committed-date>
  <authored-date>2009-04-13T08:12:43-07:00</authored-date>
  <message>allow records to be found with a string id</message>
  <tree>279ccca7b3eeda03c951cb87f4c1ef5167dd4a67</tree>
  <committer>
    <name>Chad Pytel</name>
    <email>cpytel@thoughtbot.com</email>
  </committer>
</commit>
