These are chat archives for dry-rb/chat

Nov 2018
Mikhail Slyusarev
Nov 07 2018 02:10
hey, is there a way to easily reuse procs for calls to validate() within schemas? when i assign procs to variables (and call as validate(validation_key: %I[param1 param2], &stored_proc)), I get "+proc+ is not a valid predicate name"
it does however seem to work if instead of doing stored_proc = proc { |a, b| a <= b } I do stored_proc = { |a, b| a<= b }, but that way makes rubocop unhappy. why does doing the proc {} syntax not work?
Nikita Shilnikov
Nov 07 2018 07:41
because proc isn't defined within schema's DSL
you can use ::Kernel.proc
Nov 07 2018 13:06
hi there! is it possible to translate keys in dry-v errors?