instance method
validate_each
Ruby on Rails 3.2.22.5
Since v3.1.12 Last seen in v3.2.22.5Available in: v3.1.12 v3.2.22.5
Signature
validate_each(record, attr, val)
No documentation comment.
Parameters
-
recordreq -
attrreq -
valreq
Source
# File activemodel/lib/active_model/validations/with.rb, line 12
def validate_each(record, attr, val)
method_name = options[:with]
if record.method(method_name).arity == 0
record.send method_name
else
record.send method_name, attr
end
end
Defined in activemodel/lib/active_model/validations/with.rb line 12
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveModel::Validations::WithValidator