Permalink
Browse files

validations should be uniq

  • Loading branch information...
1 parent 786713a commit 3ae408b063582792df6e0c9ad5f1a7964bf195ac @saks committed Aug 15, 2012
@@ -4,7 +4,7 @@ module HelperMethods
private
def _merge_attributes(attr_names)
options = attr_names.extract_options!
- options.merge(:attributes => attr_names.flatten)
+ options.merge(:attributes => attr_names.flatten.uniq)
end
end
@@ -14,7 +14,7 @@ class PresenceValidationTest < ActiveModel::TestCase
end
def test_validate_presences
- Topic.validates_presence_of(:title, :content)
+ Topic.validates_presence_of(:title, :content, :content)
t = Topic.new
assert t.invalid?

0 comments on commit 3ae408b

Please sign in to comment.