These are chat archives for dry-rb/chat

26th
Oct 2016
Piotr Solnica
@solnic
Oct 26 2016 09:52
@deepj what do you mean?
Andrew Kozin
@nepalez
Oct 26 2016 11:39

@solnic @AMHOL @flash-gordon @fran-worley what do you think about adding https://github.com/nepalez/dry-client to the community?

Some time ago @timriley wrote that the project is too frameworky (and I agree, it is), but... well, I'm about to publish it on rubygems and need to decide, whether to keep it dry- or better select another name

Piotr Solnica
@solnic
Oct 26 2016 11:41
I agree with Tim that it is too frameworky :)
Andrew Kozin
@nepalez
Oct 26 2016 11:41
:construction_worker:
Ok, I'll rename it
Piotr Solnica
@solnic
Oct 26 2016 13:05
@nepalez that’s the tough part I suppose ;)
Nikita Shilnikov
@flash-gordon
Oct 26 2016 13:05
wet-client
Andrew Kozin
@nepalez
Oct 26 2016 13:07
It will be evil-client
Piotr Solnica
@solnic
Oct 26 2016 13:08
hah :metal:
George Millo
@georgemillo
Oct 26 2016 17:16
hey everyone, I'm trying out dry-validation for the first time
excited to give it a go
just wondering, what precisely does filled mean?
"Use it when a value is expected to be filled." http://dry-rb.org/gems/dry-validation/basics/macros/
just that just mean non-nil?
or would e.g. an empty string be considered not filled? (similar to activemodel's blank?)
Piotr Solnica
@solnic
Oct 26 2016 17:38
@georgemillo cool! welcome on board. filled? is actually the only really complex predicate, it checks if something is not-empty. This means it’s gonna work with strings, arrays, hashes etc. anything that can be checked for emptiness
George Millo
@georgemillo
Oct 26 2016 17:39
so it just delegates to the ruby method empty?
?

here's another conundrum confusing me:

schema = Dry::Validation.Schema do
  required(:foo).filled(:int?, gt?: 10, lt?: 20)
end

schema.call(foo: 9).messages
# => {:foo=>["must be greater than 10", "must be less than 20"]}

Why am I getting the 'must be less than 20' error message as well as the 'greater than 10' one? The number I passed is less than 20

am I using filled correctly?
George Millo
@georgemillo
Oct 26 2016 18:26
/ nvm, I got an answer to the above question elsewhere