Browse files

Generate permalink when :min_lenght option is not meet

  • Loading branch information...
1 parent 7710ae2 commit 59c191737ea69ce40bdaf06750c4655513932940 @unixcharles unixcharles committed Apr 17, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/permalink_fu.rb
View
2 lib/permalink_fu.rb
@@ -31,7 +31,7 @@ def escape(str, klass = nil)
s.gsub!(/^\-|\-$/i, '') # Remove leading/trailing separator.
s.downcase!
s = "#{klass}-#{s}" if klass && Integer(s) rescue s
- s.size == 0 ? ClassMethods.random_permalink : s
+ s = s.size < klass.classify.constantize.permalink_options[:min_length] ? ClassMethods.random_permalink : s
end
end

0 comments on commit 59c1917

Please sign in to comment.