aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/validations_repair_helper.rb
diff options
context:
space:
mode:
authorwangjohn <wangjohn@mit.edu>2013-02-21 13:40:48 -0500
committerwangjohn <wangjohn@mit.edu>2013-03-19 12:23:20 -0400
commit3ee30ca44a6f965c2e9a60bcf84b45d9be726509 (patch)
tree2e4aee7523f6579db95300a7ccb19cada3d73c99 /activerecord/test/cases/validations_repair_helper.rb
parent7d659ae9cd52cc0f752c09341989eb453dc0c536 (diff)
downloadrails-3ee30ca44a6f965c2e9a60bcf84b45d9be726509.tar.gz
rails-3ee30ca44a6f965c2e9a60bcf84b45d9be726509.tar.bz2
rails-3ee30ca44a6f965c2e9a60bcf84b45d9be726509.zip
The repair_validations helper was not working correctly before because
it only cleared the validations that created :validate callbacks. This didn't include the validates created by validates_with, so I've added a method to clear all validations.
Diffstat (limited to 'activerecord/test/cases/validations_repair_helper.rb')
-rw-r--r--activerecord/test/cases/validations_repair_helper.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/cases/validations_repair_helper.rb b/activerecord/test/cases/validations_repair_helper.rb
index 11912ca1cc..c02b3241cd 100644
--- a/activerecord/test/cases/validations_repair_helper.rb
+++ b/activerecord/test/cases/validations_repair_helper.rb
@@ -6,7 +6,7 @@ module ActiveRecord
def repair_validations(*model_classes)
teardown do
model_classes.each do |k|
- k.reset_callbacks(:validate)
+ k.clear_validators!
end
end
end
@@ -16,7 +16,7 @@ module ActiveRecord
yield
ensure
model_classes.each do |k|
- k.reset_callbacks(:validate)
+ k.clear_validators!
end
end
end