Module: ActiveModel::Validations::ResolveValue
Do not use. This module is for internal use only.
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | activemodel/lib/active_model/validations/resolve_value.rb |
Instance Method Summary
Instance Method Details
#resolve_value(record, value)
[ GitHub ]# File 'activemodel/lib/active_model/validations/resolve_value.rb', line 6
def resolve_value(record, value) case value when Proc if value.arity == 0 value.call else value.call(record) end when Symbol record.send(value) else if value.respond_to?(:call) value.call(record) else value end end end