Sha256: 810badac73d214cd0d46ab026ad3c0f8c68859b528ae35f7c171699187859a29

Contents?: true

Size: 570 Bytes

Versions: 4

Compression:

Stored size: 570 Bytes

Contents

require "dry-validation"
require "dry/validation/version"
require "reform/validation"
require "reform/form/dry/input_hash"

module Reform::Form::Dry
  def self.included(includer)
    if Gem::Version.new(Dry::Validation::VERSION) > Gem::Version.new("0.13.3")
      require "reform/form/dry/new_api"
      validations = Reform::Form::Dry::NewApi::Validations
    else
      require "reform/form/dry/old_api"
      validations = Reform::Form::Dry::OldApi::Validations
    end

    includer.send :include, validations
    includer.extend validations::ClassMethods
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
reform-2.3.3 lib/reform/form/dry.rb
reform-2.3.2 lib/reform/form/dry.rb
reform-2.3.1 lib/reform/form/dry.rb
reform-2.3.0.rc2 lib/reform/form/dry.rb