Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Sep 23 13:31
    timriley synchronize #181
  • Sep 23 13:31

    timriley on explicit-two-way-component-dir-namespaces

    Support configuring namespaces … (compare)

  • Sep 23 13:01
    timriley synchronize #181
  • Sep 23 13:01

    timriley on explicit-two-way-component-dir-namespaces

    Make it possible to resolve top… (compare)

  • Sep 23 12:56
    timriley synchronize #181
  • Sep 23 12:56

    timriley on explicit-two-way-component-dir-namespaces

    Remove unused error Tweak docs and param names in C… Make it possible to resolve top… (compare)

  • Sep 23 05:23
    nkelton starred dry-rb/dry-monads
  • Sep 22 15:36
  • Sep 22 12:33
    timriley synchronize #181
  • Sep 22 12:33

    timriley on explicit-two-way-component-dir-namespaces

    Flesh out Identifier tests (and… (compare)

  • Sep 22 12:30
    timriley synchronize #181
  • Sep 22 12:30

    timriley on explicit-two-way-component-dir-namespaces

    Change Identifier attr name to … Flesh out Identifier tests (and… (compare)

  • Sep 22 11:21
    skryukov edited #92
  • Sep 22 11:06
    skryukov opened #92
  • Sep 22 10:52
  • Sep 22 05:36
    timriley synchronize #181
  • Sep 22 05:36

    timriley on explicit-two-way-component-dir-namespaces

    Introduce NullComponent and cle… Fix rubocop issues (compare)

  • Sep 22 05:22
    timriley synchronize #181
  • Sep 22 05:22

    timriley on explicit-two-way-component-dir-namespaces

    Fix rubocop issues (compare)

  • Sep 22 05:15
    timriley synchronize #181
Lorenzo Arribas
@larribas
Piotr Solnica
@solnic
@larribas one thing I plan to add is to be able to treat a schema as a rule
so, theoretically you’d be able to apply schema recursively
this would be an interesting use case
it would also help in re-using schemas
Lorenzo Arribas
@larribas
reusing schemas would be a great addition
but even so, referencing the same schema from inside of it may require some kind of lazy evaluation or delayed const_get-ish thing, right?
Piotr Solnica
@solnic
@larribas nah, it would just require some additional interface to specify “validate with self"
as in apply all rules from self
API ideas most welcome :)
Andy Holland
@AMHOL
I always love self
:p
Lorenzo Arribas
@larribas
:P
Piotr Solnica
@solnic
@wafcio so, what kind of issues did you have with dry-v?
Krzysztof Wawer
@wafcio

so my opinion about dry-validation - it has freaky error format: sometime I see

errors = schema.call(email: 'jane@doe.org', age: 17).messages

puts errors.inspect
# { :age => [["age must be greater than 18"], 17] }

another time I see

errors = schema.call(email: nil, age: 19).messages

puts errors.inspect
# { :email => [["email must be filled", nil]] }

I caused that I droped dry-validation today.

Piotr Solnica
@solnic
wow what happened with the formating here?
Krzysztof Wawer
@wafcio
I have always problem with formatting in this strange style and strange new line keys
maybe I will back to dry-validation when I will have more time
Piotr Solnica
@solnic
I’m not sure what the problem is, it gives you errors
Krzysztof Wawer
@wafcio
I wanted use drop validation in API where I need return validation keys
and when I saw
[[„invalid”, nil]]
I said WHAT ???
invalid was my translation message
Piotr Solnica
@solnic
so what’s the problem?
first array includes compiled error messages, the second argument is the original input value
Krzysztof Wawer
@wafcio
and for this I must write own wrapper, and when I open README and saw that sometimes there is construction like
[[…, …], …]
I said not today
Piotr Solnica
@solnic
what is your desired format?
error messages can be compiled to anything, I just used a simple hash for now as the default but it can be literally anything, it’s a pluggable “behavior” in dry-v
Krzysztof Wawer
@wafcio
{ attribute: [error, error], attribute: [error, error]}
like it was in 0.1.0 version
Piotr Solnica
@solnic
so you don’t like the fact you’ve got original value?
Krzysztof Wawer
@wafcio
for now I have this requirement from frontend app
Piotr Solnica
@solnic
I put it there because it’s useful for cases like each rule and figuring out the index of a given value when it comes from an array
displaying these errors is still pretty simple though, not sure why it has put you off :)
errors.each { |attribute, (messages, _)| … } or something
Krzysztof Wawer
@wafcio
I don’t understand why there is two different format: { :age => [["age must be greater than 18"], 17] } and { :email => [["email must be filled", nil]] }
Piotr Solnica
@solnic
two formats?
Krzysztof Wawer
@wafcio
[[…], …] and [[…, …]]
Piotr Solnica
@solnic
oh, now THAT seems like a bug :joy:
I will try to repro and fix
Krzysztof Wawer
@wafcio
I read it from README file
maybe README is old
Piotr Solnica
@solnic
maybe I made a mistake writing readme, that’s more likely :)
Krzysztof Wawer
@wafcio
ok
Piotr Solnica
@solnic
lemme see
Krzysztof Wawer
@wafcio
so I will give chance dry-validation, again :)
Piotr Solnica
@solnic
yeah, it’s a bug, I’ll fix it and push a release