Hey everyone, I just fixed the last remaining issue with has(n, :through) assignment at http://github.com/snusnu/dm-accepts_nested_attributes/tree/master . There is also a blogpost at http://sick.snusnu.info/2009/04/08/dm-accepts_nested_attributes/
This means that dm-accepts_nested_attributes now supports all operations (create/update/destroy) on all kinds of associations! With this in place, there should be nothing (serious) stopping you from writing those nice multimodel forms and submit them to a standard REST controller. (yeah I know, not all dm lovers write web apps, but hey, I do it :) That said, currently (as far as I know) only rails also has support for nested attribute assignment in its view helpers (form_for and fields_for), merb (maybe) doesn't. However, this should be no big deal, since there's nothing stopping you from writing the html input fields with proper name attributes yourself. I do this anyway, so I really don't care too much. Of course, this is still all very fresh, and I expect it to have quite a few bugs still. Also, I haven't tested it in a real world app yet, but there are quite some specs in place, to build upon. Currently, the plugin only works with 0.9.11 and I expect that quite some changes will be needed to make it work with datamapper/next branch, but atm I can't spend time on this because I only use 0.9.11 One thing missing compared to its activerecord counterpart, is the ability to specify a :reject_if lambda, that gets evaluated before the change to the associated records is made. I will start looking into this as soon as I find the need to do this in my current project. I also expect the code to offer loads of opportunities for refactoring :) I'd really appreciate it, if anyone takes the time to look into it, discuss it, fork it, patch it, whatever. Let's make this rock solid, so that once rails3 is orm agnostic, no one can say that they don't use datamapper because they can't do nested attribute assignment with it :) cheers snusnu --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
