Sha256: 48c009615855cf8c2e47cfb80e8d0601997af8bf634f28ec35551451aba7682d

Contents?: true

Size: 404 Bytes

Versions: 8

Compression:

Stored size: 404 Bytes

Contents

module ActiveRecord
  module ValidationsRepairHelper
    extend ActiveSupport::Concern

    module ClassMethods
      def repair_validations(*model_classes)
        teardown do
          model_classes.each(&:clear_validators!)
        end
      end
    end

    def repair_validations(*model_classes)
      yield if block_given?
    ensure
      model_classes.each(&:clear_validators!)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ibm_db-5.2.0 test/cases/validations_repair_helper.rb
ibm_db-5.1.0 test/cases/validations_repair_helper.rb
ibm_db-5.0.5 test/cases/validations_repair_helper.rb
ibm_db-5.0.4 test/cases/validations_repair_helper.rb
ibm_db-5.0.3 test/cases/validations_repair_helper.rb
ibm_db-5.0.2 test/cases/validations_repair_helper.rb
ibm_db-4.0.0-x86-mingw32 test/cases/validations_repair_helper.rb
ibm_db-4.0.0 test/cases/validations_repair_helper.rb