These are chat archives for dry-rb/chat

18th
Jan 2016
Hannes Nevalainen
@kwando
Jan 18 2016 09:53
should everybody be able to edit dry-validation wiki? =S I just made a change there and thought it would do a change request.. =P (changed Dry::Validation::Predicates to Dry::Logic::Predicates in the "custom predicates" section)
Piotr Solnica
@solnic
Jan 18 2016 09:58
@kwando thanks, for now it’s ok for everybody to have access
Hannes Nevalainen
@kwando
Jan 18 2016 10:17
@solnic roger roger
Nick Sutterer
@apotonick
Jan 18 2016 10:23
:+1:
Fran Worley
@fran-worley
Jan 18 2016 13:13
This message was deleted
Fran Worley
@fran-worley
Jan 18 2016 13:45
@solnic as this dryrb/dry-validation#47 is pretty key to what I'm doing right now, I'm looking into this now and will raise a PR when I have something meaningful.
Piotr Solnica
@solnic
Jan 18 2016 13:55
@fran-worley oh, I got it working locally
gimme 15 mins and I’ll push it
Fran Worley
@fran-worley
Jan 18 2016 13:55
:star2: :smile: Thanks!!
I added this
you can grab dry-v from master
this is actually a whole new feature
Fran Worley
@fran-worley
Jan 18 2016 15:12
@solnic You are amazing. I'll check this out now.
Fran Worley
@fran-worley
Jan 18 2016 15:22
@solnic well that works, I'll check it out with some more of my examples and get back to you :smile:
Fran Worley
@fran-worley
Jan 18 2016 15:31
@solnic one tiny little thing... If I call the rule :email_presence it doesn't hook the error to right field for form rendering purposes. I appreciate that this is completely outside the remit for dry-v but is there a way to hook the rule to :email whilst keeping the ability to reference the error message through :email_presence
Quite happy to work around this if not.
Piotr Solnica
@solnic
Jan 18 2016 15:34
just call it :email
Fran Worley
@fran-worley
Jan 18 2016 15:35
@solnic Just got there!
Should learn to think before I type...
Piotr Solnica
@solnic
Jan 18 2016 15:40
no worries :)
this still needs some work though
unfortunately I ran out of time today, so I’ll continue tomorrow
Fran Worley
@fran-worley
Jan 18 2016 15:41
Thanks so much. Might just get my update out on time!!
Piotr Solnica
@solnic
Jan 18 2016 15:53
I need to add support for grouping rules under the same key, needed for error messages
maybe using a hash for the name would be the simplest solution
ie rule(email: :presence) { … }
then you can provide a custom message under email.presence
Fran Worley
@fran-worley
Jan 18 2016 15:54
Yup just bumped into that. I like that idea.
Piotr Solnica
@solnic
Jan 18 2016 15:55
IIRC we don’t rely on rule name being a symbol, it’s just an identifier, so could be anything
I’ll look into that tomorrow
Fran Worley
@fran-worley
Jan 18 2016 15:55
cool. Thanks again for your hard work and help!
Tiago Moraes
@tiagoefmoraes
Jan 18 2016 21:14
why there's no Types::Coercible::Date?
can't find the reason anywhere...
Piotr Solnica
@solnic
Jan 18 2016 21:16
@tiagoefmoraes Types::Coercible only supports kernel coercions
for complex coercions there’s form category
more will be added soon
like json
Tiago Moraes
@tiagoefmoraes
Jan 18 2016 21:37
and it's right there in the README...
need to wait for dryrb/dry-data#16 then
thanks again
Great work with all this!!!
Piotr Solnica
@solnic
Jan 18 2016 22:28
@tiagoefmoraes thanks :)