lib/ardb/has_slug.rb in ardb-0.27.2 vs lib/ardb/has_slug.rb in ardb-0.27.3

- old
+ new

@@ -31,13 +31,16 @@ }) # since the slug isn't written till an after callback we can't always # validate presence of it validates_presence_of(attribute, :on => :update) - validates_uniqueness_of(attribute, { - :case_sensitive => true, - :scope => options[:unique_scope] - }) + + if options[:skip_unique_validation] != true + validates_uniqueness_of(attribute, { + :case_sensitive => true, + :scope => options[:unique_scope] + }) + end after_create :ardb_has_slug_generate_slugs after_update :ardb_has_slug_generate_slugs end