Hey,

Rupert, thx a lot for the patches! I integrated them into my master
branch, right after adding (experimental) support for dm-validations.
Check it out at

http://github.com/snusnu/dm-accepts_nested_attributes/commits/master

There is definitely still a lot to be done to make support for
dm-validations solid. Things that come to my mind are basically specs
and wrapping everything inside a transaction. The only currently
specced (auto)validations are not-null constraints - without
dm-constraints in action. A small and probably incomplete list of
things to do would be:

* specs for custom validations
* specs for adding associated resource errors to the saving resource
  * the code is in place but completely unspecced, didn't even check in irb
* specs for atomic commits (transactions)
  * i was playing with wrapping every save inside a transaction =>
http://pastie.org/446060
  * i can see that this would produce nested transactions ... is this
a problem?

I was talking to Michael Klishin and Dan Kubb on irc, and we seem to
agree that (at least parts of) the specs for the integration of
dm-accepts_nested_attributes with dm-validations should probably live
in the dm-validations specsuite. The main reason for this is that it
seems wrong to spec every possible (or worse, only some) usage of a
validation in combination with nested model assignment, inside the
dm-accepts_nested_attributes specsuite. It should be possible to write
specs that prove once and for all, that the way
dm-accepts_nested_attributes alters the Resource#save behavior plays
well with the way dm-validations alters this behavior. Since saving
nested models with validation is basically a matter of validating and
saving all associated resources *in the right order* (belongs_to
first, then has) within one atomic commit (transaction), it seems
logical to place these specs inside dm-validations specsuite.

That being said, it's obvious that there is still some work to do. I
will work on things as I need them for my main project, but me and
Rupert would still appreciate any additional feedback or help in any
possible way :-)

cheers
snusnu

On Tue, Apr 14, 2009 at 20:23, Rupert Voelcker <[email protected]> wrote:
>
>> Rupert is kind enough to work on this in his fork, thx again Rupert!
>
> and tis done - and I presume it'll be in Martins repo too once he's
> had a chance to look it over.
>
> Rupert
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to