Permalink
Browse files

Rollback [4917]. Closes #785.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5067 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 9d9ac01 commit 7c4b6a55b61229ef5f2f053c9a88a738497c70cf @jeremy jeremy committed Sep 7, 2006
View
2 activerecord/CHANGELOG
@@ -12,8 +12,6 @@
* Optimistic locking: gracefully handle nil versions, treat as zero. #5908 [Tom Ward]
-* validates_confirmation_of only kicks in when the attribute, rather than its confirmation, is present. #785 [z@wzph.com]
-
* to_xml: the :methods option works on arrays of records. #5845 [Josh Starcher]
* Deprecation: update docs. #5998 [jakob@mentalized.net, Kevin Clark]
View
3 activerecord/lib/active_record/validations.rb
@@ -333,8 +333,7 @@ def validates_confirmation_of(*attr_names)
attr_accessor *(attr_names.map { |n| "#{n}_confirmation" })
validates_each(attr_names, configuration) do |record, attr_name, value|
- confirm = record.send("#{attr_name}_confirmation")
- record.errors.add(attr_name, configuration[:message]) unless value.nil? || value == confirm
+ record.errors.add(attr_name, configuration[:message]) unless record.send("#{attr_name}_confirmation").nil? or value == record.send("#{attr_name}_confirmation")
end
end
View
4 activerecord/test/validations_test.rb
@@ -179,11 +179,11 @@ def test_no_title_confirmation
assert t.valid?
t.title_confirmation = "Parallel Lives"
- assert t.valid?
+ assert !t.valid?
t.title_confirmation = nil
t.title = "Parallel Lives"
- assert !t.valid?
+ assert t.valid?
t.title_confirmation = "Parallel Lives"
assert t.valid?

0 comments on commit 7c4b6a5

Please sign in to comment.