Sha256: 1024718fdf6b0fe7220859e7afa9981e56ea2b15309da385ccd0ea1cb43e5f24

Contents?: true

Size: 435 Bytes

Versions: 6

Compression:

Stored size: 435 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

6 entries across 6 versions & 2 rubygems

Version Path
ibm_db-5.5.0 test/cases/validations_repair_helper.rb
ibm_db-5.4.1 test/cases/validations_repair_helper.rb
ibm_db-5.4.0 test/cases/validations_repair_helper.rb
ibm_db-5.3.2 test/cases/validations_repair_helper.rb
ibm_db-5.3.1 test/cases/validations_repair_helper.rb
ruby-on-quails-0.1.0 activerecord/test/cases/validations_repair_helper.rb