These are chat archives for dry-rb/chat

2nd
Sep 2016
RKushnir
@RKushnir
Sep 02 2016 09:39
Hi. Is it possible to set a global config option, e.g. messages = :i18n?
RKushnir
@RKushnir
Sep 02 2016 09:44
found it Dry::Validation::Schema::Form.config.messages = :i18n
RKushnir
@RKushnir
Sep 02 2016 11:03
is it possible to turn off the hints?
Rafael George
@cored
Sep 02 2016 13:16
@solnic let me know when you are available
Piotr Solnica
@solnic
Sep 02 2016 13:20
@cored hey man, sorry, crazy week…I’ll be working on issues etc. later today, I’ll ping you
Rafael George
@cored
Sep 02 2016 13:25
cool
thanks
Michał Warda
@michalwarda
Sep 02 2016 13:30
Is there a way to contribute to the documentation parts of dry-rb gems?
Piotr Solnica
@solnic
Sep 02 2016 14:16
@michalwarda of course! we keep everything in github.com/dry-rb/dry-rb.org
and of course we desperately need API docs (YARD) too, but this will become more important once gems are closer to 1.0.0’s
Finished in 10.2 seconds (files took 1.13 seconds to load)
2411 examples, 0 failures, 46 pending
@fran-worley ^^^^ !!!!!!!!
…onto the last part now - re-adding lightweight result objects so it’s faster and making success results optional :)
pheeewww, getting there…
RKushnir
@RKushnir
Sep 02 2016 14:24
is there a way to use dynamic arguments inside of a rule block?
RKushnir
@RKushnir
Sep 02 2016 14:30
here’s what I need to achieve
rule(price_within_range: %i(price offer_id)) do |price, offer_id|
  price.filled?.then(
    price.gteq?(Offer.find(offer_id).minimum_price) &
    price.gteq?(Offer.find(offer_id).maximum_price)
  )
end
Piotr Solnica
@solnic
Sep 02 2016 14:35
@RKushnir not yet, I’ll be adding this in 0.10.0
RKushnir
@RKushnir
Sep 02 2016 14:36
@solnic thanks, looking forward :)
RKushnir
@RKushnir
Sep 02 2016 15:01
@solnic do you know if I can pass arguments to the error messages? Say I validate a url with filled(:url, youtube_url?: :channel), and I’d like error to be “must be a YT channel link”, while also supporting :video and :user kinds of urls
Piotr Solnica
@solnic
Sep 02 2016 15:31
@RKushnir all arguments of a predicate are available in a message template
Fran Worley
@fran-worley
Sep 02 2016 15:48
@solnic I've been watching your commits as they come through. Can't wait to try it out.
Piotr Solnica
@solnic
Sep 02 2016 15:49
@fran-worley it’s been a messy process, I’ll be cleaning things up before merging in
I hope to finish this tomorrow
RKushnir
@RKushnir
Sep 02 2016 16:14
@solnic it would be nice to have more control over how error messages are built, for example, when rules filled(foo?: :bar) and filled(foo?: :baz) require different error messages, and you cannot distinguish them by type because they are both symbols
Piotr Solnica
@solnic
Sep 02 2016 16:18
@RKushnir pls report an issue describing what you’d like to achieve
RKushnir
@RKushnir
Sep 02 2016 16:18
ok
Mohamed Ziata
@WaKeMaTTa
Sep 02 2016 16:39
This message was deleted