Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

bugfixes to validation regex and messages

  • Loading branch information...
commit 873e59037819a2d1f1b456a35841f6ba08ca1127 1 parent 53ef1a1
Ben Koski authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/slug/slug.rb
4 lib/slug/slug.rb
View
@@ -20,9 +20,9 @@ def slug source, opts={}
self.slug_column = opts.has_key?(:column) ? opts[:column] : :slug
- validates_presence_of self.slug_column, :message => "#{self.slug_column} cannot be blank. Is #{self.slug_source} sluggable?"
+ validates_presence_of self.slug_column, :message => "cannot be blank. Is #{self.slug_source} sluggable?"
validates_uniqueness_of self.slug_column
- validates_format_of self.slug_column, :with => /^[a-z0-9-]+/, :message => "#{self.slug_column} contains invalid characters. Only downcase letters, numbers, and '-' are allowed."
+ validates_format_of self.slug_column, :with => /^[a-z0-9-]+$/, :message => "contains invalid characters. Only downcase letters, numbers, and '-' are allowed."
before_validation_on_create :set_slug
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.