These are chat archives for dry-rb/chat

23rd
Jul 2015
Andy Holland
@AMHOL
Jul 23 2015 09:10
Getting somewhere with this now
Andy Holland
@AMHOL
Jul 23 2015 09:26
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
Jul 23 2015 09:53
looking good
Andy Holland
@AMHOL
Jul 23 2015 09:58
:)
Piotr Solnica
@solnic
Jul 23 2015 09:58
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
Jul 23 2015 10:00
Yeah, I've seen a few cases of that too lol
Piotr Solnica
@solnic
Jul 23 2015 10:00
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
Jul 23 2015 10:00
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
Jul 23 2015 10:06
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
Jul 23 2015 10:17
You could have told me this earlier :joy:
Piotr Solnica
@solnic
Jul 23 2015 10:21
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
Jul 23 2015 10:22
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
Jul 23 2015 10:23
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
Jul 23 2015 10:23
Ahh OK
Piotr Solnica
@solnic
Jul 23 2015 10:23
AR, all ORMS, Virtus, Anima, all 3124 Virtus clones etc.
Andy Holland
@AMHOL
Jul 23 2015 10:23
I didn't know that about AR
haha
~clones~
Piotr Solnica
@solnic
Jul 23 2015 10:24
sorry, that was a bit rude but it’s the truth :)
Andy Holland
@AMHOL
Jul 23 2015 10:24
Nah, it wasn't, I know what you mean
Was just funny :)
Piotr Solnica
@solnic
Jul 23 2015 10:25
[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
Jul 23 2015 10:25
Cool
I'll change it to hash accessor tonight
Piotr Solnica
@solnic
Jul 23 2015 10:25
I think you can get pretty far by just supporting [] initially
Andy Holland
@AMHOL
Jul 23 2015 10:25
I need to stop force pushing too lol
Piotr Solnica
@solnic
Jul 23 2015 10:25
dear lord what’s up with all of you force pushing all the time :)
Andy Holland
@AMHOL
Jul 23 2015 10:25
I just like the 0.1.0 release to be the initial commit :p
Piotr Solnica
@solnic
Jul 23 2015 10:26
nepalez is doing the same :D
Andy Holland
@AMHOL
Jul 23 2015 10:26
OCD, right?
Piotr Solnica
@solnic
Jul 23 2015 10:27
I…dunno, depending on what that acronym means in that context :)
Andy Holland
@AMHOL
Jul 23 2015 10:27
Obsessive Compulsive Disorder
Piotr Solnica
@solnic
Jul 23 2015 10:27
right, I thought so
Andy Holland
@AMHOL
Jul 23 2015 10:28
:laughing:
Probably quite common in developers
Piotr Solnica
@solnic
Jul 23 2015 10:29
I used to be very purisitic about code
it changed a lot over the last couple of years
these days I’m pretty relaxed about pushing WIPs, breaking things and fixing them, refactoring later etc.
I feel like I’ve found the balance here
Andy Holland
@AMHOL
Jul 23 2015 10:30
Yeah, it's difficult, but when you're working for someone, you have to put your opinions aside and get shit done
Piotr Solnica
@solnic
Jul 23 2015 10:30
my only opinion is that at any point in time we’re all wrong :D
Andy Holland
@AMHOL
Jul 23 2015 10:30
:joy:
any/all point/points
Piotr Solnica
@solnic
Jul 23 2015 10:31
I like what my friend said once
whenever somebody asks him about something
he’s like
“I can’t tell you what it is exactly but I can tell you what I think about it today. But tomorrow I may think something else” :D
“it" being anything
Andy Holland
@AMHOL
Jul 23 2015 10:32
wise words
Piotr Solnica
@solnic
Jul 23 2015 10:33
yeah it may sound funny but it’s the truth, we’re all wrong, all the time, we’re just becoming less wrong, slowly, over time
so things like “strong opinions” are silly
Andy Holland
@AMHOL
Jul 23 2015 10:33
Speak for yourself :laughing:
Piotr Solnica
@solnic
Jul 23 2015 10:33
haha
yeah man :)
I prefer to think like that, really :)
Andy Holland
@AMHOL
Jul 23 2015 10:34
Yeah, its probably better that way
I love looking back at my old code
Shows me how far I've come
Piotr Solnica
@solnic
Jul 23 2015 10:34
well, there are some people out there who are extremely happy with a framework they created 11 years ago, but it’s not a common thing to see
Andy Holland
@AMHOL
Jul 23 2015 10:34
cough DHH cough
Piotr Solnica
@solnic
Jul 23 2015 10:35
typically a programmer hates his/her code after only a short period of time
Andy Holland
@AMHOL
Jul 23 2015 10:35
Yep, I'm with you there lol
Generally the first time you have to change it
Piotr Solnica
@solnic
Jul 23 2015 10:36
it’s like after a month you see sth could be done better, after 3 months you want to change some APIs, after 6 months you want to partially rewrite it and after a year you hate it lol
Andy Holland
@AMHOL
Jul 23 2015 10:36
Like, has former me never heard of open/closed principle
I normally get there after 2 months TBF lol
Piotr Solnica
@solnic
Jul 23 2015 10:38
that really depends on how much you learn
so it can vary a lot
Andy Holland
@AMHOL
Jul 23 2015 10:38
Yeah, that's the good thing about working in a large team / doing OSS, you learn a lot, fast
Piotr Solnica
@solnic
Jul 23 2015 10:39
people who don’t learn much will be more happy with their code, there’s nothing wrong with that, it just works like that
oh yeah
I’ve definitely become a better programmer through OSS
learned way more than at work
esp that most of my work was Rails even though my projects were freaking huge with complex domains, but still, AR-crusades nothing else
Andy Holland
@AMHOL
Jul 23 2015 10:40
same here TBH
Piotr Solnica
@solnic
Jul 23 2015 10:40
btw I tried to tackle things differently but Rails + AR == HUGE assumptions about the design so you just can’t beat that shit easily
Andy Holland
@AMHOL
Jul 23 2015 10:41
inorite, I tried to use composition with AR/AM with what I'm working on now
Makes things hard
Piotr Solnica
@solnic
Jul 23 2015 10:41
hah yeah
Andy Holland
@AMHOL
Jul 23 2015 10:42
I hate elasticsearch and RabbitMQ lol
Have to reindex and restart all the time
Andy Holland
@AMHOL
Jul 23 2015 10:47
What do you think about the interface for Dry::Validator BTW?
Piotr Solnica
@solnic
Jul 23 2015 10:48
oh yeah? I enjoyed RabbitMQ but never tried ES
the interface? which one? call?
Andy Holland
@AMHOL
Jul 23 2015 10:48
More the initializer/rule structure
each: and embedded: to be precise
Piotr Solnica
@solnic
Jul 23 2015 10:55
I think it’s pretty cool
I’d probably use a different name, sth more generic
like Rule
I mean for various stuff like presence etc
Andy Holland
@AMHOL
Jul 23 2015 10:56
:+1:
Piotr Solnica
@solnic
Jul 23 2015 10:56
sorry, dealing with too many things at once so my feedback is kinda chaotic
Andy Holland
@AMHOL
Jul 23 2015 10:56
That woks better
Piotr Solnica
@solnic
Jul 23 2015 10:56
we could have Rules::Presence or maybe even sth more narrow like Rules::Constraints::Presence because you may have diff kinds of rules
Andy Holland
@AMHOL
Jul 23 2015 10:56
So like, Dry::Rules::Presence rather than Dry::Validations::Presence etc.
Piotr Solnica
@solnic
Jul 23 2015 10:56
yes
Andy Holland
@AMHOL
Jul 23 2015 10:57
Much better
Piotr Solnica
@solnic
Jul 23 2015 10:57
and each and embedded is more like a…hmm
I dunno, more like a composition instruction
Andy Holland
@AMHOL
Jul 23 2015 10:57
Yeah, naming things :p
Piotr Solnica
@solnic
Jul 23 2015 10:57
each == compose all those rules
embedded compose with this validator
inorite :)
conditional validation is my personal pet peeve btw, yet to see an elegant solution
Andy Holland
@AMHOL
Jul 23 2015 10:59
I was thinking about that
Like contextual validation
Piotr Solnica
@solnic
Jul 23 2015 10:59
for example something that drives me nuts in AM::Validations
Andy Holland
@AMHOL
Jul 23 2015 10:59
Validator composition ;)
Piotr Solnica
@solnic
Jul 23 2015 10:59
is when you define presence and then numericality and something is blank and you get 2 errors
that sth cannot be blank and sth must be a number
(つ◉益◉)つ
Andy Holland
@AMHOL
Jul 23 2015 11:00
Ahh yeah
But I think that's down to the user
Piotr Solnica
@solnic
Jul 23 2015 11:01
right, that’s probaby no the best example
Andy Holland
@AMHOL
Jul 23 2015 11:01
If I say { presence: true } with { length: 2..5 } then I should just remove the presence validation
Piotr Solnica
@solnic
Jul 23 2015 11:01
but it drives me nuts
because presence is presence, regardless of the type
something must exist
and it should only fail if it doesn't
and it has bullshit stuff like allow_blank
so, is it presence validation or type validation?
things like that
Andy Holland
@AMHOL
Jul 23 2015 11:02
Yeah
Piotr Solnica
@solnic
Jul 23 2015 11:02
semantics
it’s messed up
Andy Holland
@AMHOL
Jul 23 2015 11:02
I thought you meant like validation for new vs persisted object
Piotr Solnica
@solnic
Jul 23 2015 11:02
also lack of type validation is like…what on earth, 11 years in the making and no type checking
Andy Holland
@AMHOL
Jul 23 2015 11:02
lol
Piotr Solnica
@solnic
Jul 23 2015 11:03
so you end up with really messy validations and conditionals
Andy Holland
@AMHOL
Jul 23 2015 11:03
Hopefully we can solve this?
Piotr Solnica
@solnic
Jul 23 2015 11:03
because of presence/allow blank/lack of type checking
we can totally solve this :)
Andy Holland
@AMHOL
Jul 23 2015 11:03
You reminded me before, I need to find a way around this:
https://github.com/dryrb/dry-validator/blob/master/lib/dry/validations/embedded.rb#L7
Piotr Solnica
@solnic
Jul 23 2015 11:03
I have it all in my head wrt requirements, just need some time to focus on it solely to describe certain use cases, I will do that
hey can I share a link to this project with the guys?
the guys == Luca and Nick
Andy Holland
@AMHOL
Jul 23 2015 11:04
Yeah, definitely :+1:
Piotr Solnica
@solnic
Jul 23 2015 11:04
we’ll be discussing validations tomorrow
ok doing so now
the thing is you, ma, nepalez, luca and nick are all interested in a solid validation library, so I’d love to see if we can find some common ground and work together
we should be able to deliver something really good in a matter of a month or two if we work together
the only problem is that they are not entirely where we are wrt FPish Ruby
Andy Holland
@AMHOL
Jul 23 2015 11:07
They want validate :name, presence: true ?
:laughing:
Piotr Solnica
@solnic
Jul 23 2015 11:08
actually the DSL part is less concerning here
you can build whatever DSL you want on top of tools like dry-validator
similar story about transproc
Andy Holland
@AMHOL
Jul 23 2015 11:09
Yeah
Piotr Solnica
@solnic
Jul 23 2015 11:09
that’s the actual power and beauty of small, composable functionalish libs
Andy Holland
@AMHOL
Jul 23 2015 11:10
I was thinking for the readme:
*I want I18n for my errors, why doesn't your library provide this?*

Errors are objects to y'know, just create a presenter:

*Example presenter code*
Piotr Solnica
@solnic
Jul 23 2015 11:11
btw for errors (I actually prefer it they were called violations or sth similar)
we need nice simple objects with all the info
what rule was violated, what objects were involved etc
everything that’s needed to compose a user-friendly message, use locales etc
Andy Holland
@AMHOL
Jul 23 2015 11:12
I thought the current errors hash was sufficient, or do you mean without presenters?
Piotr Solnica
@solnic
Jul 23 2015 11:12
I don’t think it’ll be enough, long term
not just that actually, hash is a huge interface, so at the same time it’s too much :D
so, not sufficient to be easily used and too much bloat from Hash at the same time :)
Andy Holland
@AMHOL
Jul 23 2015 11:14
Hmm, so a custom class is necessary you think?
Piotr Solnica
@solnic
Jul 23 2015 11:15
99.9% sure it is needed
Andy Holland
@AMHOL
Jul 23 2015 11:16
I was just thinking it would get messy if we start mixing concerns like I18n
Piotr Solnica
@solnic
Jul 23 2015 11:22
haven’t thought much about presentation layer yet
except that I know it’s a separate layer
a higher level validation lib could provide a DSL on top of dry validators with some presentation logic and I18n integration
Andy Pike
@andypike
Jul 23 2015 11:30
Hi everyone, I was just wondering about dry-container, looks interesting. I did a proof of concept a while ago here: https://github.com/andypike/injectr of something similar. What's the motivation for dry-container?
Andy Holland
@AMHOL
Jul 23 2015 11:34
Hi @andypike, it was something extracted from a gem I made called roda-container, the motivation was just to avoid hardcoded dependencies and allow configuration of dependencies, code to an interface and all that
Piotr Solnica
@solnic
Jul 23 2015 11:39
@andypike I started using dry-container in a rails app with a simple auto-injection, works like a charm and my classes are no longer concerned about building their dependencies
auto-injections is custom code, not OSSed
but I’m sure we can come up with something
Andy Pike
@andypike
Jul 23 2015 11:40
Cool! Does it resolve dependencies through an object graph via constructor injection?
Piotr Solnica
@solnic
Jul 23 2015 11:41
yeah kinda, you explicitly say what you want to inject using names of the registered deps in the container
so it looks more or less like that: extend AutoInject(:foo, :bar)
and you’re gonna have foo and bar injected into constructor
I’ll try to write an OSS lib for that or maybe add it to dry-container
we are still exploring :)
Andy Pike
@andypike
Jul 23 2015 11:42
does that go into the class? I come from a .NET background (now just ruby) and have a lot of experience with IoC if you want some help.
Piotr Solnica
@solnic
Jul 23 2015 11:43
I really love this approach, it’s so simple and helps a lot. like I already moved a couple of things around, renamed classes, moved files and all I had to do was to change container registration, everything else just worked
and even if I decided to rename the identifiers it would also be a simple change
@andypike oh that’s good to know, we’d definitely need help
I’ve never used any IoC in other langs than Ruby where I always had my ad-hoc “solutions"
Andy Pike
@andypike
Jul 23 2015 11:44
in my PoC I use the arg name to look up the dependency in the container so your classes can be PORO
Piotr Solnica
@solnic
Jul 23 2015 11:44
it’s the first time I’m actually trying to use something more concrete
yeah I do the same
Andy Pike
@andypike
Jul 23 2015 11:44
ah cool
Piotr Solnica
@solnic
Jul 23 2015 11:45
I used Concord lib which allows you to easily define composition so you just do include Concord.new(:foo, :bar) and it gives you a constructor that accepts those deps + you can ask it about the names, which is what I used for AutoInject
Andy Pike
@andypike
Jul 23 2015 11:46
since moving to ruby (rails) it seems that nobody uses IoC and I often wondered why.
Piotr Solnica
@solnic
Jul 23 2015 11:46
so auto-inject builds concord, includes it in a module and define included hook for it that will resolve and inject what’s needed, it’s still pretty ad-hoc but I can easily turn it into a more solid thing
oh yeah man, I can tell you why
it’s because how rails was always advertised and how many known people, esp DHH, hate anything that comes from Java or .NET, esp Java
so we’d been hearing things like “you don’t need IoC and DI in Ruby because you can monkey-patch” and other horror-arguments
I also remember some talks showing how IoC/DI can become super complicated in Ruby as an argument against its usage
Andy Pike
@andypike
Jul 23 2015 11:49
yeah, I get the sense that people that go straight to rails miss out on a bunch of good OO lessons
Piotr Solnica
@solnic
Jul 23 2015 11:49
I haven’t experienced that even though I used some ad-hoc solutions, so I really can’t understand how it can go wrong with more solid approaches
rails comes with a mentality of taking shortcuts to quickly achieve something, thinking about dependencies and coupling slows you down
Andy Pike
@andypike
Jul 23 2015 11:50
yep, short term wins vs long term pain
Piotr Solnica
@solnic
Jul 23 2015 11:50
right
I wrote a pretencious blog post about simple DI in ruby a while ago: http://solnic.eu/2013/12/17/the-world-needs-another-post-about-dependency-injection-in-ruby.html
Andy Pike
@andypike
Jul 23 2015 11:52
cool, will check it out. I need to head off now, but I'm interested in helping (looking for some OSS projects to contribute to) so let's keep in touch :smile:
Piotr Solnica
@solnic
Jul 23 2015 11:52
oh man that’s fantastic!
Peter Bhat Harkins
@pushcx
Jul 23 2015 11:52
Just woke up here in the states, reading backlog.
Andy Pike
@andypike
Jul 23 2015 11:53
I'll have a play with this later. cya :wave:
Piotr Solnica
@solnic
Jul 23 2015 11:53
@andypike me and @AMHOL are hanging out here and also in rom-rb/chat + microrb/microrb.com + solnic/transproc - some cool projects are being discussed in all those places, help is alwas welcome :)
@pushcx hey there Peter
Peter Bhat Harkins
@pushcx
Jul 23 2015 11:57
Hey, thanks for inviting me :)
How can I contribute?
Piotr Solnica
@solnic
Jul 23 2015 12:00
@pushcx we’re discussing things, that’s the current state of things :)
my motivation is to have a reusable lower level, flexible validation library
notice that we’re not looking for inventing another validation DSL
but focusing on composability and extendibility
DSLs can be built on top of that
just like we did with transproc + rom mapper
Peter Bhat Harkins
@pushcx
Jul 23 2015 12:01
Sure. Is dryrb a first pass, or one person's prototype?
Piotr Solnica
@solnic
Jul 23 2015 12:05
Andy literally pushed dry-validator yesterday but we talked about it many times
there’s also nepalez’s assertion lib that’s worth taking a look
I would love to see validation DSLs built on top of something more functional and composable/reusable - that’s probably my biggest motivation; I’ve suffered from inflexibility and weird semantics of AM::Validations so I’m really hoping we could improve the situation
Andy Holland
@AMHOL
Jul 23 2015 12:12
Just looking at lotus validations, looks like they handle coercion too?
Piotr Solnica
@solnic
Jul 23 2015 12:13
ah, right that part I missed completely, for me that’s actually a major smell
Andy Holland
@AMHOL
Jul 23 2015 12:13
Yeah, I was thinking the same
Piotr Solnica
@solnic
Jul 23 2015 12:14
catching type errors is related to validations but it’s not validator responsibility to coerce
not to mention that mixing type definitions with validation rules == DSL mess
we’ve been there with DM1
Andy Holland
@AMHOL
Jul 23 2015 12:30
@solnic how have you found testing with IoC, in principle, you should be able to avoid allow(object).to receive
Piotr Solnica
@solnic
Jul 23 2015 12:34
yeah of course I don’t do that
I use doubles
but I’m not super happy with rspec’s mocking tbh
Andy Holland
@AMHOL
Jul 23 2015 12:34
Does that mean a testing library is next on the list? lol
Piotr Solnica
@solnic
Jul 23 2015 12:43
yes
/o\
Andy Holland
@AMHOL
Jul 23 2015 12:43
:laughing:
Does /o\ mean what I think it means?
Piotr Solnica
@solnic
Jul 23 2015 12:46
it means this:
Andy Holland
@AMHOL
Jul 23 2015 12:46
Ahh OK lol
That's a no then
Piotr Solnica
@solnic
Jul 23 2015 12:46
there’s also \o/ and \o |o| o//
Andy Holland
@AMHOL
Jul 23 2015 12:47
haha nice, I don't know how I missed it
I just realised, that's you on a webcam shot, right? ^^
Piotr Solnica
@solnic
Jul 23 2015 12:48
yes
Andy Holland
@AMHOL
Jul 23 2015 12:48
:laughing:
I won't do one showing you what I thought it was
Piotr Solnica
@solnic
Jul 23 2015 12:49
omg OK
I like this emoticon, too bad it’s not in emojis, my haskell notes in evernote are titled “Haskell /o\"
Andy Holland
@AMHOL
Jul 23 2015 12:50
Is that down to the type system?
Piotr Solnica
@solnic
Jul 23 2015 12:51
and my latest bio says “A rubyists learning Haskell /o\” it’s probaby because I often sit holding my head like that when I read sth stuff that requires focus :D
not best position for my back but oh well
down to the type system?
as in the reson for learning it?
Andy Holland
@AMHOL
Jul 23 2015 12:51
Yeah, you said it was hard to grasp
The reason you're doing /o\
Piotr Solnica
@solnic
Jul 23 2015 12:53
yeah, switching to a statically type lang is a big shift
but in case of haskell it’s probably even more difficult as its type system is kinda crazy powerful
Andy Holland
@AMHOL
Jul 23 2015 12:54
I need to look into this at some point
Piotr Solnica
@solnic
Jul 23 2015 12:55
it has some simple beautiful concepts too that are easy to understand, like you can define a data type with specific attributes and use Eq interface to get equality support OOTB, very explicit and clear. in Ruby equality stuff is so messy
Andy Holland
@AMHOL
Jul 23 2015 12:56
Sounds cool
Piotr Solnica
@solnic
Jul 23 2015 12:57
there’s a lot of stuff that you can encode within the custom types and a lot of testing goes away not to mention catching stupid bugs at compilation time. but I barely scratched the surface so it’s hard to say anything more about that, need to build something real first (and relatively big)
Andy Holland
@AMHOL
Jul 23 2015 12:58
Did you see that PostREST thing on HN?
Piotr Solnica
@solnic
Jul 23 2015 12:58
I’ve read quite some criticism too so even though I’m excited I don’t see it as any kind of a silver bullet
yes I did
Andy Holland
@AMHOL
Jul 23 2015 12:58
WDYT?
Piotr Solnica
@solnic
Jul 23 2015 12:58
I just saw it, didn’t read :)
Andy Holland
@AMHOL
Jul 23 2015 12:58
Ahh OK
You should :smile:
Piotr Solnica
@solnic
Jul 23 2015 12:59
will do
ok I gotta run, ttyl
Andy Holland
@AMHOL
Jul 23 2015 12:59
:+1:
:wave:
Andy Holland
@AMHOL
Jul 23 2015 17:39
Updated the validator, ignore build errors, was the wrong build, and just rubocop
Andy Holland
@AMHOL
Jul 23 2015 18:20
@solnic added option to pass a validator to each and embedded, check it out if you get a chance :)
Andy Holland
@AMHOL
Jul 23 2015 22:22
embedded_user_validator.call(user: user)
# => {:user=>[{:name=>[{:code=>"presence", :value=>"", :options=>true}]}]}
Need to make that a hash rather than an array :/
Either that or return a hash with a code for embedded and array, which could make sense, if you want to validate the type or w.e. too
Think that may be the way to go
As processing, for presentation or w.e., would be easier too