dry-bot on master
[devtools] config sync (compare)
dry-bot on master
[devtools] config sync (compare)
dry-bot on master
[devtools] config sync (compare)
dry-bot on master
[devtools] config sync (compare)
dry-bot on master
[devtools] config sync (compare)
dry-bot on master
[devtools] config sync (compare)
dry-bot on master
[devtools] config sync (compare)
dry-bot on master
[devtools] config sync (compare)
dry-bot on master
[devtools] config sync (compare)
dry-bot on master
[devtools] config sync (compare)
dry-bot on master
[devtools] config sync (compare)
dry-bot on master
[devtools] config sync (compare)
dry-bot on master
[devtools] config sync (compare)
dry-bot on master
[devtools] config sync (compare)
dry-bot on master
[devtools] config sync (compare)
dry-bot on master
[devtools] config sync (compare)
dry-bot on master
[devtools] config sync (compare)
dry-bot on master
[devtools] config sync (compare)
/home/monkey/.gem/ruby/2.2.5/gems/dry-types-0.9.0/lib/dry/types/compiler.rb:80:in `merge': no implicit conversion of Dry::Types::Safe into Hash (TypeError)
from /home/monkey/.gem/ruby/2.2.5/gems/dry-types-0.9.0/lib/dry/types/compiler.rb:80:in `each'
case
for simple ugh ... cases
messages
that merge both errors and hints, this turned out to be problematic in some cases so it was separated in 0.10.0
So I tried
required(:user_id).maybe(:int?)
required(:global_auth_id).maybe(:str?)
rule(valid_user: [:user_id, :global_auth_id]) do |user_id, global_auth_id|
user_id.false?.then(global_auth_id.filled?)
end
rule(valid_auth_id: [:user_id, :global_auth_id]) do |user_id, global_auth_id|
global_auth_id.false?.then(user_id.filled?)
end
but i get
>> @schema.call(global_auth_id: '2')
=> #<Dry::Validation::Result output={:global_auth_id=>"2"} messages={:user_id=>["is missing"]}>
>> @schema.call(user_id: nil)
=> #<Dry::Validation::Result output={:user_id=>nil} messages={}>
>> @schema.call(user_id: 1)
=> #<Dry::Validation::Result output={:user_id=>1} messages={:global_auth_id=>["is missing"]}>
>> @schema.call(global_auth_id: '1')
=> #<Dry::Validation::Result output={:global_auth_id=>"1"} messages={:user_id=>["is missing"]}>
>> @schema.call(global_auth_id: '1', user_id: nil)
=> #<Dry::Validation::Result output={:user_id=>nil, :global_auth_id=>"1"} messages={:user_id=>["must be filled"]}>