Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

validations should be uniq

  • Loading branch information...
commit 3ae408b063582792df6e0c9ad5f1a7964bf195ac 1 parent 786713a
@saks authored
View
2  activemodel/lib/active_model/validations/with.rb
@@ -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
View
2  activemodel/test/cases/validations/presence_validation_test.rb
@@ -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?
Please sign in to comment.
Something went wrong with that request. Please try again.