Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 06:22
    zlei1 starred dry-rb/dry-web
  • Nov 18 00:58
    dteoh starred dry-rb/dry-types
  • Nov 17 21:02
    flash-gordon commented #374
  • Nov 17 21:01

    flash-gordon on master

    Update custom_ci.yml Merge pull request #374 from sk… (compare)

  • Nov 17 21:01
    flash-gordon closed #374
  • Nov 17 20:59
    skryukov opened #374
  • Nov 17 16:42

    flash-gordon on use-immutable-equalizer

    (compare)

  • Nov 17 16:42

    flash-gordon on master

    Use immutable equalizer for all… Merge pull request #373 from dr… (compare)

  • Nov 17 16:42
    flash-gordon closed #373
  • Nov 17 16:38
    flash-gordon opened #373
  • Nov 17 16:38

    flash-gordon on use-immutable-equalizer

    Use immutable equalizer for all… (compare)

  • Nov 17 16:34

    flash-gordon on no-rewrap-for-structs

    (compare)

  • Nov 17 16:34

    flash-gordon on master

    Don't build constructors when c… Merge pull request #371 from dr… (compare)

  • Nov 17 16:34
    flash-gordon closed #371
  • Nov 16 11:28
    marekciupak starred dry-rb/dry-monads
  • Nov 16 07:48
    luizfonseca starred dry-rb/dry-view
  • Nov 15 18:52
    waiting-for-dev commented #114
  • Nov 15 16:06
    businessBoris starred dry-rb/dry-system
  • Nov 15 15:16
    businessBoris starred dry-rb/dry-monads
  • Nov 15 08:22
    gruz0 starred dry-rb/dry-types
Andy Holland
@AMHOL
Yeah, just give me a shout when you do
Piotr Solnica
@solnic
will do
Andy Holland
@AMHOL
@solnic you around?
Piotr Solnica
@solnic
Kinda
Andy Holland
@AMHOL
lol, just messing about with the validator stuff
Piotr Solnica
@solnic
Oh cool. Where?
Andy Holland
@AMHOL
Not pushed it anywhere yet, just making a gist
The gist vs the comment
I'm leaning towards the gist myself, that would allow the processor to be switched out for nested validations or anything else someone wants to do
Then I can put the extractor/validation container config on the processor
WDYT?
Piotr Solnica
@solnic
I'll check it out tomorrow. Too late for me already :)
Andy Holland
@AMHOL
:+1: cheers
Andy Holland
@AMHOL
Getting somewhere with this now
Andy Holland
@AMHOL
v = Dry::Validator.new(
  name: {
    presence: true
  },
  test: {
    embedded: {
      tester: {
        presence: true
      }
    }
  }
)

v.call(name: '', test: { tester: '' })
# => {:name=>[{:code=>"presence", :options=>true}], :test=>[{:tester=>[{:code=>"presence", :options=>true}]}]}
v.call(name: 'Joe', test: { tester: 't' })
# => {}
v = Dry::Validator.new(
  users: {
    each: {
      name: {
        presence: true
      }
    }
  }
)

v.call(users: [{ name: 'Joe' }, { name: '' }])
# => {:users=>[{}, {:name=>[{:code=>"presence", :options=>true}]}]}
v.call(users: [{ name: 'Joe' }])
# => {}
Piotr Solnica
@solnic
looking good
Andy Holland
@AMHOL
:)
Piotr Solnica
@solnic
btw I really like Dry name
because Dry has been misunderstood by many rubyists and not everybody realized what it really means
Andy Holland
@AMHOL
Yeah, I've seen a few cases of that too lol
Piotr Solnica
@solnic
FWIW DRY in Rails mostly means “I’m gonna use reflection and make millions of assumptions so that you will just inherit from this magic class and more magic will appear"
:sparkles:
Andy Holland
@AMHOL
haha yeah
AR DRY
Was wondering whether this was going to turn into a framework last night lol
I think that developing these small libraries with small concerns makes for better code
Piotr Solnica
@solnic
small libs are fantastic except one thing
it’s called dependency hell :)
it’s the reason why I don’t like to start with small libs and prefer extractions
and I am very very careful about deciding when it’s good to extract
extracting unstable code will always mean much more work
we’ve been there with DM2 that’s how I’ve learned it, the hard way™
Andy Holland
@AMHOL
You could have told me this earlier :joy:
Piotr Solnica
@solnic
haha nah man, those things in Dry has been done in one form or another so many times we’re in a good position to build them up from scratch in isolation
I’m talking about things like building a biggerish thing like ROM via bottom-up approach, that part didn’t work at all for DM2
hey so
this part, I’m not sure if it’s a good idea to try both [] and a reader
seems too ambiguous to me
Andy Holland
@AMHOL
Yeah, it was just that I wanted it to be able to validate an object or a hash without configuration, but I did think that it was a bit of a smell myself
Piotr Solnica
@solnic
probably sticking to [] would be best, but that’s just my initial gut feeling
yeah right?
truth is 99% of the libs with data-objects provide both [] AND readers
Andy Holland
@AMHOL
Ahh OK
Piotr Solnica
@solnic
AR, all ORMS, Virtus, Anima, all 3124 Virtus clones etc.
Andy Holland
@AMHOL
I didn't know that about AR
haha
~clones~