solnic / virtus

[DISCONTINUED ] Attributes on Steroids for Plain Old Ruby Objects
MIT License
3.77k stars 228 forks source link

Injectible coercers in ev #198

Closed solnic closed 10 years ago

solnic commented 10 years ago

This PR makes it possible to inject coercers even when using EmbeddedValue like described in #197

solnic commented 10 years ago

@cflipse can you take a look at the spec here (it's based on your original one) and tell me if that's what you needed?

It's actually inline with the concept of primitive coercions (string, float etc) where attribute object uses a coercer to do the job. It was different in EV as it was not using a coercer. I changed it so that it uses a coercer replacing EV-subclasses which is sort of how it used to be in 1.0.0.beta0.

I'll clean it up a bit and merge it in if that's what you need :)

solnic commented 10 years ago

One more thing - the same problem exists in Collection now, you can't inject a coercer. I should probably update it too so that it uses a coercer just like any other attribute.

cflipse commented 10 years ago

Yep, revised spec still looks like what I'm after. thanks!

solnic commented 10 years ago

@cflipse this is now available in beta7. thanks for testing :smile: