These are chat archives for dry-rb/chat

19th
May 2016
Fran Worley
@fran-worley
May 19 2016 06:13
@timriley nicely done :+1: Do you do much work outside AUS?
Tim Riley
@timriley
May 19 2016 06:14
@fran-worley thanks! We haven’t done a whole lot, but we’d certainly be open to it.
Fran Worley
@fran-worley
May 19 2016 06:21
@timriley good to know. Got a few bits on my To-Do list I recon IceLabs would be perfect for.
James Hamilton
@wjdhamilton
May 19 2016 07:13
Guys, in the docs for dry-validation/basics/macros.html.md at the end there's a section I'm struggling to interpret:

confirmation

Use it when another value under key with a _confirmation prefix is expected to be equal.
Dry::Validation.Schema do
  # expands to:
  #
  # rule(password_confirmation: [:password]) do |password|
  #   value(:password_confirmation).eql?(password) }
 # end
 #
   key(:password).required(min_size?: 12).confirmation
 end
This message was deleted
Does this mean that the library is looking for a different key in the same hash with _confirmation after it? i.e. password_confirmation?
James Hamilton
@wjdhamilton
May 19 2016 07:27
@timriley Good post - particularly liked the part about "simple, not easy"
Luca Guidi
@jodosha
May 19 2016 07:49

@wjdhamilton Hey, it should be:

schema = Dry::Validation.Schema do
  required(:password).filled(min_size?: 12).confirmation
end

To make it pass:

result = schema.call(password: '1234567890123', password_confirmation: '1234567890123')
# => #<Dry::Validation::Result output={:password=>"1234567890123", :password_confirmation=>"1234567890123"} messages={}>

result.success?
# => true
irb(main):006:0> result = schema.call(password: '1234567890123')
=> #<Dry::Validation::Result output={:password=>"1234567890123"} messages={:password_confirmation=>["must be equal to 1234567890123"]}>
irb(main):007:0> result.success?
=> false
James Hamilton
@wjdhamilton
May 19 2016 07:51
OK! So the line under confirmation should read something like: Use it when another value in the same candidate mapped to the same key suffixed with _confirmation should be equal
Luca Guidi
@jodosha
May 19 2016 07:54
@wjdhamilton Yes
James Hamilton
@wjdhamilton
May 19 2016 07:55
@jodosha Thank you! I'm putting in a PR for a couple of typos so I'll add a humanised version my mouthful too
James Hamilton
@wjdhamilton
May 19 2016 08:07
This message was deleted
@solnic just put in a PR (dry-rb/dry-rb.org#67) to correct a couple of typos in the docs for dry-validation
Luca Guidi
@jodosha
May 19 2016 08:16
:)
Piotr Solnica
@solnic
May 19 2016 09:47
@timriley https://www.reddit.com/r/ruby/ <= you’re at the top
Piotr Solnica
@solnic
May 19 2016 10:02
@timriley this is great, I just re-read it (I read it yesterday but I was too sleepy :D)
Tim Riley
@timriley
May 19 2016 10:12
@solnic thanks! Now I'll spend the next few weeks actually trying to demonstrate all of that :)
Piotr Solnica
@solnic
May 19 2016 10:13
that’s gonna be a challenge
Tim Riley
@timriley
May 19 2016 10:20
With the blog posts, I've resolved to take lots of really tiny steps.
Piotr Solnica
@solnic
May 19 2016 10:21
good strategy
Piotr Solnica
@solnic
May 19 2016 12:15
@timriley https://www.reddit.com/r/ruby/comments/4k02u4/a_changepositive_ruby_web_application_architecture/d3bheyq I know you’d probably come up with a more polite response but I couldn’t help myself
James Hamilton
@wjdhamilton
May 19 2016 12:20
@solnic @timriley If you read his other comments outside that thread you'll see he's approaching being a troll. Seems to spend most of his time attacking other people's work. Sad really.
Piotr Solnica
@solnic
May 19 2016 12:20
I had that impression w/o reading his other comments
the problem is that lots of people may read his comment and just “nod” w/o thinking
because he sounds so freaking confident
James Hamilton
@wjdhamilton
May 19 2016 12:21
It's a general problem with online discussions. Bothering to read something and question it begins to separate the thinkers from the followers
Piotr Solnica
@solnic
May 19 2016 12:22
right
James Hamilton
@wjdhamilton
May 19 2016 12:22
Also, you have to consider his tone. If you think it's OK to sneer at someone for writing a post about programming then you really need to think about what's important in life
And, finally, whilst I'm distracted from my wiki entry, he doesn't actually address the post at all. Just has a 'don't criticise Rails' rant with some vague references to Tim's post.
Piotr Solnica
@solnic
May 19 2016 12:29
yep, this generation of programmers is making me sad (I mean literally sad)
James Hamilton
@wjdhamilton
May 19 2016 12:31
I suspect it goes back to the points we were making yesterday about the difference between easy and simple
Simple is hard work
Easy is instant gratification
Robustly defending your easy code as good programming probably necessitates some trolling :worried:
:laughing:
there we go
well, whatever, time for lunch
ain’t gonna continue replying, it’s a waste of time
Fran Worley
@fran-worley
May 19 2016 12:37
Yeah what a 💩
James Hamilton
@wjdhamilton
May 19 2016 12:37
:laughing:
Andy Holland
@AMHOL
May 19 2016 12:53
This guy is getting tag teamed by Solnic and Nathan Ladd
You gotta feel sorry for him :laughing:
Take that as you will but the sexual connotation was not intentional
James Hamilton
@wjdhamilton
May 19 2016 12:57
Sexual connotation? I had WWF in mind
Fran Worley
@fran-worley
May 19 2016 12:57
😭
Andy Holland
@AMHOL
May 19 2016 12:59
@wjdhamilton me too lol
@fran-worley :see_no_evil: :speak_no_evil:
James Hamilton
@wjdhamilton
May 19 2016 12:59
Phew! I thought I was showing my age for a second
As in everyone thought I meant the World Wildlife Fund
Andy Holland
@AMHOL
May 19 2016 13:00
haha
All my mates watched Wrestling in primary school, I didn't see the appeal of watching grown men pretend to fight in leather underpants
James Hamilton
@wjdhamilton
May 19 2016 13:00
Some kind of Panda jelly wrestling show
Neither did I. I liked Big Daddy. He was just a big fat guy bouncing about a ring
Andy Holland
@AMHOL
May 19 2016 13:02
:laughing:
James Hamilton
@wjdhamilton
May 19 2016 13:04
And his first name was Shirley.
Piotr Solnica
@solnic
May 19 2016 13:11
Oh this escalates quickly :laughing:
Nikita Shilnikov
@flash-gordon
May 19 2016 13:54
wow, this guy is such an anti-pattern, I wouldn't be surprise if he consists of antimatter...
Andy Holland
@AMHOL
May 19 2016 14:22
lol
Luca Guidi
@jodosha
May 19 2016 14:50
@timriley Your last article is a really good read. These are the same principles that made me to start Hanami. :clap:
Don Morrison
@elskwid
May 19 2016 15:24
That reddit thread is the reason I do not go to reddit.
Piotr Solnica
@solnic
May 19 2016 15:24
@elskwid I force myself to do that because I don’t want to live in a comfy bubble
Don Morrison
@elskwid
May 19 2016 15:24
@solnic but, but, I like my bubble
WHY DON’T YOU GO LEARN SOME SQL PIOTR?!?!?
That’ll get you out of your bubble (since it’s very clear you don’t know how great SQL can be)
Piotr Solnica
@solnic
May 19 2016 15:26
inorite
Don Morrison
@elskwid
May 19 2016 15:26
All of that person’s responses were designed to trigger my irritation - they’re very good at it.
Like, very very good.
I wonder if they work for a government agency...
Piotr Solnica
@solnic
May 19 2016 19:50
This message was deleted
Andy Holland
@AMHOL
May 19 2016 20:33
I think he works for Basecamp