Class: Reform::Form::ActiveModel::Validations::Validator
Class Method Summary
collapse
Instance Method Summary
collapse
#build_errors, included, #read_attribute_for_validation
Constructor Details
#initialize(form) ⇒ Validator
Returns a new instance of Validator.
93
94
95
96
|
# File 'lib/reform/form/active_model/validations.rb', line 93
def initialize(form)
super(form)
self.class.model_name = form.model_name end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args, &block) ⇒ Object
98
99
100
|
# File 'lib/reform/form/active_model/validations.rb', line 98
def method_missing(m, *args, &block)
__getobj__.send(m, *args, &block) end
|
Class Method Details
.attr_reader ⇒ Object
Prevent AM:V from mutating the validator class
86
87
|
# File 'lib/reform/form/active_model/validations.rb', line 86
def attr_reader(*)
end
|
.attr_writer ⇒ Object
89
90
|
# File 'lib/reform/form/active_model/validations.rb', line 89
def attr_writer(*)
end
|
.model_name ⇒ Object
73
74
75
|
# File 'lib/reform/form/active_model/validations.rb', line 73
def model_name
@_active_model_sucks ||= ActiveModel::Name.new(Reform::Form, nil, "Reform::Form")
end
|
.model_name=(name) ⇒ Object
77
78
79
|
# File 'lib/reform/form/active_model/validations.rb', line 77
def model_name=(name)
@_active_model_sucks = name
end
|
.validates(*args, &block) ⇒ Object
81
82
83
|
# File 'lib/reform/form/active_model/validations.rb', line 81
def validates(*args, &block)
super(*Declarative::DeepDup.(args), &block)
end
|