Sha256: bfdc8d0a6ddb69e8a3c948d5a999cfc6c15cf43e6da91a036f70d1b8b884ed1b

Contents?: true

Size: 444 Bytes

Versions: 2

Compression:

Stored size: 444 Bytes

Contents

module ActiveRecord
  module ValidationsRepairHelper
    extend ActiveSupport::Concern

    module ClassMethods
      def repair_validations(*model_classes)
        teardown do
          model_classes.each do |k|
            k.clear_validators!
          end
        end
      end
    end

    def repair_validations(*model_classes)
      yield
    ensure
      model_classes.each do |k|
        k.clear_validators!
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activerecord-nuodb-adapter-1.1 test/cases/validations_repair_helper.rb
activerecord-nuodb-adapter-1.0.4 test/cases/validations_repair_helper.rb