Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 17:03
    paul commented #32
  • 16:44
    paul commented #32
  • 10:56
    solnic commented #32
  • 10:30
    solnic commented #32
  • Dec 05 09:29

    solnic on master

    Clear exception message when an… Add gem names to plugins Merge pull request #128 from sk… (compare)

  • Dec 05 09:29
    solnic closed #128
  • Dec 05 09:29
    solnic closed #127
  • Dec 04 18:49
    micahphone starred dry-rb/dry-monads
  • Dec 04 17:43
    icy-arctic-fox starred dry-rb/dry-types
  • Dec 02 12:37
    pedrofurtado starred dry-rb/dry-view
  • Dec 02 11:59
    lenon starred dry-rb/dry-monads
  • Dec 01 11:06

    flash-gordon on declare-finalized

    (compare)

  • Dec 01 11:06

    flash-gordon on master

    Set initial value for ivar Merge pull request #131 from dr… (compare)

  • Dec 01 11:06
    flash-gordon closed #131
  • Dec 01 11:05
    flash-gordon opened #131
  • Dec 01 11:03

    flash-gordon on declare-finalized

    Set initial value for ivar (compare)

  • Nov 30 16:50
    paul commented #32
  • Nov 30 16:50
    paul synchronize #32
  • Nov 30 16:44
    paul synchronize #32
Andy Holland
@AMHOL
@solnic I'll push what I've got so far, see what you think
Piotr Solnica
@solnic
@AMHOL sure
Andy Holland
@AMHOL
dryrb/dry-validation@cbc17e5
So the idea is that we can have a dry-validation-i18n gem for error messages
BTW, now I've got to grips with it a lot more, you've done a fantastic job so far
Piotr Solnica
@solnic
@AMHOL no idea what "to grip" means :D
Andy Holland
@AMHOL
:laughing: idioms
Piotr Solnica
@solnic
dammit mate
;)
Andy Holland
@AMHOL
To get to grips = to get a better understanding :)
So if I get to grips with {something}, I have a better understanding of {something} than I did before
Piotr Solnica
@solnic
Oh ok :) it is really simple piece of code tbh. Ast with visitor pattern is really simple. Probably not popular but that is ok
Aaahhh good
Andy Holland
@AMHOL
Yeah, perhaps to you ;)
Ast is complicated stuff
Piotr Solnica
@solnic
I thought so too when I saw it for the first time
Andy Holland
@AMHOL
I think it's just unfamiliar territory, from what I've seen you don't tend to touch AST until you start looking at compilers and sth?
Piotr Solnica
@solnic
Yeah only compilers deal with then
Them even
Krzysztof Wawer
@wafcio
How in dry-validation can I construct rule for attribute which is optional but if exists then it should be in specific format ? I am trying to do it in this way: id.nil? | (id.str? & id.format?(/.../)) but I receive NoMethodError: undefined method `to_ary' for true:TrueClass
Piotr Solnica
@solnic
@wafcio id.filled? & id.format?(/.../) should suffice
Although your example should work too
So pls report an issue
Krzysztof Wawer
@wafcio
I used str? because I checked examples: a) without id b) with number id - incorrect c) with id as uuid (text) - correct
Krzysztof Wawer
@wafcio
issue added dryrb/dry-validation#13
Piotr Solnica
@solnic
@wafcio thanks. I'll fix that
Krzysztof Wawer
@wafcio
ok thanks, I will bypass this problem with write own predicate
Krzysztof Wawer
@wafcio
I think it will be good to add optional attribute, right now each time key method is forcing to have specific key in attributes
Piotr Solnica
@solnic
@wafcio optional attribute or optional value? Those two are not the same
For optional attribute/key we could have sth like key(:foo).optional do ... end
Please report an issue about that
Krzysztof Wawer
@wafcio
I mean optional key, ok I will report some use case
Hannes Nevalainen
@kwando
This message was deleted
class UserSchema < Dry::Validation::Schema
  key(:age) do |age|
    age.filled? & age.int? & age.gt?(18) & age.lt?(100)
  end
end
@solnic ^^ that should work right?
Krzysztof Wawer
@wafcio
@kwando how do you invoke this schema ?
Hannes Nevalainen
@kwando
UserSchema.new.messages(user)
Krzysztof Wawer
@wafcio
what is user ?
Hannes Nevalainen
@kwando
a hash
Krzysztof Wawer
@wafcio
ok but can you give example how this hash looks ?
Hannes Nevalainen
@kwando
though the input is not there problem, it blows up when compiling the rules
the* problem
/dry-validation-185ec9d6959d/lib/dry/validation/rule_compiler.rb:48:in `visit_and': undefined method `&' for #<Dry::Validation::Rule::Conjunction:0x007fc95b01ef10> (NoMethodError)
Krzysztof Wawer
@wafcio
in 0.1.0 I don’t have this problem
Hannes Nevalainen
@kwando
ok, I use master.. probably not a very good idea =P
Krzysztof Wawer
@wafcio
I am not fun of using version from master because it can be unstable. For me stable versions are tagged versions
Hannes Nevalainen
@kwando
I do not really think there is a "stable" version yet though =P
Piotr Solnica
@solnic
@kwando there was an issue with nil? predicate, I had to rename it to none? to avoid conflicts with the built-in nil? method on Object
btw I just added support for optional values
Hannes Nevalainen
@kwando
Dry::Rule::Composite is missing & | methods