Class: ClientSideValidations::Adapters::ActiveModel

Inherits:
ORMBase
  • Object
show all
Defined in:
lib/client_side_validations/adapters/active_model.rb

Instance Attribute Summary

Attributes inherited from ORMBase

#base

Instance Method Summary collapse

Methods inherited from ORMBase

#initialize, #validation_fields

Constructor Details

This class inherits a constructor from ClientSideValidations::Adapters::ORMBase

Instance Method Details

#validations_to_hash(attr) ⇒ Object



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

def validations_to_hash(attr)
  base._validators[attr.to_sym].inject({}) do |hash, validation|
    validation.instance_variable_set('@options', validation.options.dup)
    hash.merge!(build_validation_hash(validation.dup))
  end
end