Rails supports procs for validation so that the validation can use a new value for each check, for example:
argument :name, String,
validates: { length: {
minimum: 1,
maximum: -> { Current.account.name_length_limit }
}
}
We can support some amount of this, too.
Probably not as much as Rails: validators run before runtime objects are actually ready, and they run once per AST node, not once per object, so we won't be able to pass the object into the proc.
Rails supports procs for validation so that the validation can use a new value for each check, for example:
We can support some amount of this, too.
Probably not as much as Rails: validators run before runtime objects are actually ready, and they run once per AST node, not once per object, so we won't be able to pass the object into the proc.