@solnic ping me if you have any comments on this, this allows for passing injected deps into externally defined predicates
example code from dry-v
module IssuesPredicate
include Dry::Logic::Predicates
predicate(:equipment_exists?) do |account, value|
account.include?(value)
end
end
Schema = Dry::Validation.Schema do
configure do
option :account
predicates(::IssuesPredicate)
end
optional(:equipment_ids).each { equipment_exists?(account) }
end
@solnic ping me if you have any comments on this, this allows for passing injected deps into externally defined predicates
example code from dry-v
/cc @NikitaNaumenko