Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Dec 15 19:07
    jjw starred dry-rb/dry-types
  • Dec 15 18:13

    flash-gordon on master

    Remove unreachable method (compare)

  • Dec 15 18:11

    flash-gordon on master

    Remove Dry::Types.type_keys It… (compare)

  • Dec 15 18:09

    flash-gordon on master

    Remove unreachable code (compare)

  • Dec 15 18:04

    flash-gordon on master

    Coverage for function.rb (compare)

  • Dec 15 17:15

    flash-gordon on fix-maybe-call-safe

    (compare)

  • Dec 15 17:15

    flash-gordon on master

    Fix behavior of Maybe#call_safe… Merge pull request #380 from dr… (compare)

  • Dec 15 17:15
    flash-gordon closed #380
  • Dec 15 17:13
    flash-gordon synchronize #380
  • Dec 15 17:13

    flash-gordon on fix-maybe-call-safe

    Fix behavior of Maybe#call_safe… (compare)

  • Dec 15 17:12
    flash-gordon opened #380
  • Dec 15 17:11

    flash-gordon on fix-maybe-call-safe

    Fix behavior of Maybe#call_safe… (compare)

  • Dec 15 17:00

    flash-gordon on fix-maybe-try

    (compare)

  • Dec 15 17:00

    flash-gordon on master

    Fix behavior of Types::Maybe#try Merge pull request #379 from dr… (compare)

  • Dec 15 17:00
    flash-gordon closed #379
  • Dec 15 15:09

    flash-gordon on master

    Fix typo Merge pull request #67 from gru… (compare)

  • Dec 15 15:09
    flash-gordon closed #67
  • Dec 15 14:43
    flash-gordon opened #379
  • Dec 15 14:43

    flash-gordon on fix-maybe-try

    Fix behavior of Types::Maybe#try (compare)

  • Dec 15 14:30

    flash-gordon on master

    Lax coverage (compare)

Andy Holland
@AMHOL
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~
Piotr Solnica
@solnic
sorry, that was a bit rude but it’s the truth :)
Andy Holland
@AMHOL
Nah, it wasn't, I know what you mean
Was just funny :)
Piotr Solnica
@solnic
[6] pry(main)> User.first[:name]
  User Load (0.5ms)  SELECT  "users".* FROM "users"  ORDER BY "users"."id" ASC LIMIT 1
=> "Admin"
see, defo works in AR
Andy Holland
@AMHOL
Cool
I'll change it to hash accessor tonight
Piotr Solnica
@solnic
I think you can get pretty far by just supporting [] initially
Andy Holland
@AMHOL
I need to stop force pushing too lol
Piotr Solnica
@solnic
dear lord what’s up with all of you force pushing all the time :)