Module: ClientSideValidations::Extender

Defined in:
lib/client_side_validations/extender.rb

Class Method Summary collapse

Class Method Details

.extend(klass, validators) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/client_side_validations/extender.rb', line 7

def extend(klass, validators)
  validators.each do |validator|
    require "client_side_validations/#{klass.underscore}/#{validator.downcase}"

    const_get(klass)::Validations.const_get(:"#{validator}Validator").include ClientSideValidations.const_get(klass).const_get(validator)
  end
end