<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -68,7 +68,7 @@ You can use for example User.find_by_param(params[:id], args) to find the user b
       module SingletonMethods
   
         # borrowed from http://github.com/henrik/slugalizer ;) thanks henrik http://github.com/henrik
-        def escape(str, separator='-')
+        def escape_permalink(str, separator='-')
           return &quot;&quot; if str.blank? # hack if the str/attribute is nil/blank
           re_separator = Regexp.escape(separator)
           result = ActiveSupport::Multibyte::Handlers::UTF8Handler.normalize(str.to_s, :kd)
@@ -116,7 +116,7 @@ Accepts an options hash as a second parameter which is passed on to the rails fi
           returning &quot;&quot; do |param|
             param &lt;&lt; &quot;#{id}&quot; if value.blank? || permalink_options[:prepend_id]
             param &lt;&lt; &quot;-&quot; if permalink_options[:prepend_id]
-            param &lt;&lt; &quot;#{escape_and_truncate_for_permalink(value)}&quot;
+            param &lt;&lt; &quot;#{escape_and_truncate_permalink(value)}&quot;
           end
         end
         
@@ -125,8 +125,8 @@ Accepts an options hash as a second parameter which is passed on to the rails fi
         def save_permalink
           return unless self.class.column_names.include?(permalink_options[:field].to_s)
           counter = 0
-          base_value = escape_and_truncate_for_permalink(read_attribute(permalink_options[:with]))
-          permalink_value = &quot;#{base_value}&quot;.downcase
+          base_value = escape_and_truncate_permalink(read_attribute(permalink_options[:with])).downcase
+          permalink_value = &quot;#{base_value}&quot;
           
           conditions = [&quot;#{self.class.table_name}.#{permalink_options[:field]} = ?&quot;, permalink_value]
           unless new_record?
@@ -142,17 +142,17 @@ Accepts an options hash as a second parameter which is passed on to the rails fi
         end
         
         def validate_param_is_not_blank
-          errors.add(permalink_options[:with], &quot;must have at least one non special character (a-z 0-9)&quot;) if self.escape( self.send(permalink_options[:with]) ).blank?
+          errors.add(permalink_options[:with], &quot;must have at least one non special character (a-z 0-9)&quot;) if self.escape_permalink( self.send(permalink_options[:with]) ).blank?
         end
         
-        def escape(value)
-          &quot;#{value.respond_to?(&quot;parameterize&quot;) ? value.parameterize : self.class.escape(value)}&quot;
+        def escape_permalink(value)
+          &quot;#{value.respond_to?(&quot;parameterize&quot;) ? value.parameterize.to_s : self.class.escape_permalink(value)}&quot;
         end
         
         #this escapes and truncates a value.
         #used to escape and truncate permalink value
-        def escape_and_truncate_for_permalink(value)
-          self.escape(value)[0...self.permalink_options[:param_size]]
+        def escape_and_truncate_permalink(value)
+          self.escape_permalink(value)[0...self.permalink_options[:param_size]]
         end
       end
       </diff>
      <filename>lib/find_by_param.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>8e609449a87e902ca3e90c1ed4245587f5e81a10</id>
    </parent>
  </parents>
  <author>
    <name>Michael Bumann</name>
    <email>michael@railslove.com</email>
  </author>
  <url>http://github.com/bumi/find_by_param/commit/cd247310c49690387be39e7681b7a82a337c54bf</url>
  <id>cd247310c49690387be39e7681b7a82a337c54bf</id>
  <committed-date>2009-03-09T13:32:08-07:00</committed-date>
  <authored-date>2009-03-09T13:32:08-07:00</authored-date>
  <message>fixing minor issue with active_support parameterize and downcasing saved permalink value</message>
  <tree>71a352f7963474d534ed6d356f2f7e1252625991</tree>
  <committer>
    <name>Michael Bumann</name>
    <email>michael@railslove.com</email>
  </committer>
</commit>
