Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Generate permalink when :min_lenght option is not meet

  • Loading branch information...
commit 59c191737ea69ce40bdaf06750c4655513932940 1 parent 7710ae2
Charles Barbier unixcharles authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/permalink_fu.rb
2  lib/permalink_fu.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.