Permalink
Browse files

fix uniquness

  • Loading branch information...
1 parent 3454811 commit d650d99c432ab1f2156fb714b32bf74ec60d562b @maccman maccman committed Sep 12, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/supermodel/validations/uniqueness.rb
@@ -5,7 +5,7 @@ class UniquenessValidator < EachValidator
def validate_each(record, attribute, value)
alternate = klass.find_by_attribute(attribute, value)
- return unless alternate == record
+ return unless alternate
record.errors.add(attribute, "must be unique", :default => options[:message])
end

0 comments on commit d650d99

Please sign in to comment.