These are chat archives for dry-rb/chat

6th
Sep 2016
Kiril Dokh
@dsounded
Sep 06 2016 07:58
@solnic yo, will check this out
Kiril Dokh
@dsounded
Sep 06 2016 08:10
@solnic I’m not sure if I can perform my validation even now :)
Piotr Solnica
@solnic
Sep 06 2016 08:12
@dsounded can you tell me what you're trying to do?
@fran-worley messages.first?! WDYM?
Kiril Dokh
@dsounded
Sep 06 2016 08:43
@solnic somthing like this
http://pastebin.com/LjDZgK22
As I see now it’s only allowed to use rules in rules etc
Piotr Solnica
@solnic
Sep 06 2016 08:48
@dsounded wdym?
Kiril Dokh
@dsounded
Sep 06 2016 08:48
That code I want to work inside my rule
But it throws an error
Piotr Solnica
@solnic
Sep 06 2016 08:50
@dsounded you want to see if all combinations include a correct sequence of categories, right?
Kiril Dokh
@dsounded
Sep 06 2016 08:50
Something like that
Piotr Solnica
@solnic
Sep 06 2016 08:50
I need a full example to better understand it
Kiril Dokh
@dsounded
Sep 06 2016 08:51
Hold on, I will provide another pastebin, hope it will be self explanation
Piotr Solnica
@solnic
Sep 06 2016 08:54
@dsounded could you report an issue instead?
Kiril Dokh
@dsounded
Sep 06 2016 08:54
I could, but I am not sure if I am not doing something wrong
Piotr Solnica
@solnic
Sep 06 2016 08:55
that’s OK
Kiril Dokh
@dsounded
Sep 06 2016 09:00
dry-rb/dry-validation#250
Piotr Solnica
@solnic
Sep 06 2016 10:00
@fran-worley so I did this dry-rb/dry-validation@94e8804 makes sense?
Piotr Solnica
@solnic
Sep 06 2016 12:38
@backus hey, do you think it’d be doable to wrap up dry-struct this week? if not I’ll have to release it as it is
John Backus
@backus
Sep 06 2016 13:03
Yeah I'll have some time
Just needs to be adapted to the new schema plus I need to add one other schema
Pieter VM
@pvmeerbe
Sep 06 2016 13:03
Quick question : am I wrong to assume that "required(:email)" should behave the same way as "required(:email) { none? | filled? }" , i.e. some kind of macro ?
John Backus
@backus
Sep 06 2016 13:04
I want to do a. Inch of refactorings too but those are not crucial
Fran Worley
@fran-worley
Sep 06 2016 13:05
@solnic sorry, got side tracked with Reform. Thanks for your input on dry-rb/dry-validation#232 already updated reform and it works beautifully
Piotr Solnica
@solnic
Sep 06 2016 13:09
@pvmeerbe nope, you want required(:email).maybe(:filled?)
Pieter VM
@pvmeerbe
Sep 06 2016 13:14
@solnic I got confused by the fact that just "required(:email)" without any further specifications did not trigger a validation error. To me it reads as if the key :email is required and I don't care about the value, but it actually doesn't even require the key to be present (see pastebin above). is this the expected behavior?
Fran Worley
@fran-worley
Sep 06 2016 13:18
@pvmeerbe @solnic that looks like a bug. It appears that no rule is created when you just call required(:key) on it's own:
schema = Dry::Validation.Schema do
  required(:email)
end

schema.rules
#  => {}
Piotr Solnica
@solnic
Sep 06 2016 13:28
we could change that
Fran Worley
@fran-worley
Sep 06 2016 13:29
@solnic with the messages/errors/hints improvements have you thought anymore about the hint ranking thing we were talking about a while ago? I was trying to workout how that could work with custom predicates.
Piotr Solnica
@solnic
Sep 06 2016 13:29
this is 1.0.0 stuff so not yet
Fran Worley
@fran-worley
Sep 06 2016 13:30
@solnic we probably should make sure that a key rule is added as a minimum if you call required, I can see it confusing people especially as you can't use the key? predicate independently.
Piotr Solnica
@solnic
Sep 06 2016 13:31
makes sense
Pieter VM
@pvmeerbe
Sep 06 2016 13:52
@solnic @fran-worley Ok, thanks for the info. Should I create a ticket for this?
Piotr Solnica
@solnic
Sep 06 2016 13:52
yes please
Pieter VM
@pvmeerbe
Sep 06 2016 13:57
done : dry-rb/dry-validation#251
Rafael George
@cored
Sep 06 2016 18:40
@solnic related to this issue -> dry-rb/dry-validation#244
you said that you made it work with dry-struct already but not with the optional capabilities
?
Piotr Solnica
@solnic
Sep 06 2016 18:40
@cored si
Rafael George
@cored
Sep 06 2016 18:40
oki
Piotr Solnica
@solnic
Sep 06 2016 18:40
so it’s hard-coded unconditionally right now
Rafael George
@cored
Sep 06 2016 18:40
I will start that branch from scratch
too messy at the moment
will close that PR an reopen it when I have something useful
Piotr Solnica
@solnic
Sep 06 2016 18:41
you can just force-push to the same branch
no need for another PR
Rafael George
@cored
Sep 06 2016 18:41
the good old force push
Piotr Solnica
@solnic
Sep 06 2016 18:41
just hard reset to master
Rafael George
@cored
Sep 06 2016 18:41
ok I'll do that then
Piotr Solnica
@solnic
Sep 06 2016 18:41
and -f push