Sha256: 9d15ed85d22ddbac0a1b87b0a14c2fb6efea941a954146072787d6a82c56b9b1

Contents?: true

Size: 456 Bytes

Versions: 4

Compression:

Stored size: 456 Bytes

Contents

# frozen_string_literal: true

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

4 entries across 4 versions & 1 rubygems

Version Path
ibm_db-5.5.0-x86-mingw32 test/cases/validations_repair_helper.rb
ibm_db-5.4.1-x86-mingw32 test/cases/validations_repair_helper.rb
ibm_db-5.4.0-x86-mingw32 test/cases/validations_repair_helper.rb
ibm_db-5.3.2-x86-mingw32 test/cases/validations_repair_helper.rb