1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test/cases/validations_repair_helper.rb

24 lines
462 B
Ruby
Raw Normal View History

module ActiveRecord
module ValidationsRepairHelper
2009-05-29 18:23:38 -04:00
extend ActiveSupport::Concern
module ClassMethods
def repair_validations(*model_classes)
teardown do
model_classes.each do |k|
k.reset_callbacks(:validate)
end
end
end
end
def repair_validations(*model_classes)
yield
ensure
model_classes.each do |k|
k.reset_callbacks(:validate)
end
end
end
end