Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Dec 12 21:34
    flash-gordon commented #376
  • Dec 12 21:34
    flash-gordon labeled #376
  • Dec 12 21:34
    flash-gordon opened #376
  • Dec 12 19:32
    RyanLafferty starred dry-rb/dry-types
  • Dec 12 05:53
    technofreak starred dry-rb/dry-monads
  • Dec 12 00:14
    thekuwayama starred dry-rb/dry-monads
  • Dec 11 09:29
    blasterun starred dry-rb/dry-monads
  • Dec 11 08:34
    flash-gordon closed #115
  • Dec 11 08:34
    flash-gordon commented #115
  • Dec 11 08:31

    flash-gordon on v1.3.3

    (compare)

  • Dec 11 08:30

    flash-gordon on master

    Bump version to 1.3.3 (compare)

  • Dec 11 08:30

    flash-gordon on master

    Update CHANGELOG (compare)

  • Dec 10 23:46
    johnmaxwell commented #116
  • Dec 10 21:54

    flash-gordon on master

    Halt with mutable backtrace Ex… Merge pull request #116 from jo… (compare)

  • Dec 10 21:54
    flash-gordon closed #116
  • Dec 10 21:54
    flash-gordon commented #116
  • Dec 10 21:49
    johnmaxwell commented #116
  • Dec 10 21:47
    johnmaxwell commented #116
  • Dec 10 21:43
    johnmaxwell commented #116
  • Dec 10 21:39
    johnmaxwell commented #116
Andy Holland
@AMHOL
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 :)
Andy Holland
@AMHOL
I just like the 0.1.0 release to be the initial commit :p