Hey Rupert, Glad to hear that you can put it to use! Also, many thanks for taking the time to fix up a patch! I will look into it today evening and will try to incorporate it. Dan Kubb already pointed out that the current code most probably won't work with "more complicated" many_to_many associations (especially when fiddling with child_keys/parent_keys and class_name options (this is maybe also true for other kinds of associations). I think this is mainly because atm I perform rather poor feature detection to find out exactly what association is in use.
There is one thing that probably is worth some discussion with your patch. You added some integration specs that test renamed has(n, :through) associations. I wonder if these could be moved to the unit specs, to not further clutter the integration specs. I will look into this, since somehow I have the feeling that we shouldn't need to test every possible call to has(n, :through) within this plugin's integration specs. Once we can rely on the fact that the correct association meta information is returned by the plugin's internals, there shouldn't be a need to spec all possible integration scenarios. What do you think? Anyways, as I will use it more and more to build the complex forms in my current project, I hope I will find more of these edge cases, and be able to provide a fix for them. In the meantime, thx again for your work on the patch! cheers snusnu On Mon, Apr 13, 2009 at 18:56, Rupert Voelcker <[email protected]> wrote: > > Hiya > >> I pushed http://github.com/snusnu/dm-accepts_nested_attributes/tree/master >> the other day. There is also a blogpost at >> http://sick.snusnu.info/2009/04/08/dm-accepts_nested_attributes/ > > I've just been messing with this plugin - you've created it at just > the time I needed it so thaaaaankyooou :) > > I've just patched it so that it'll work on the project I'm developing > as it wasn't working correctly for the 'non-standard' has many through > associations I was using. Patch is at: > > http://gist.github.com/94535 > > [assuming you're looking at my patched version spec fixtures] > This patched version will still fail if the associations declared in > the Photo class don't match those in the Tag class, so changing the > Photo model associations to: > > has n, :taggings > has n, :tags, :through => :taggings > > will break my added specs. I didn't try to fix this as I don't know > if datamapper requires/assumes that there are reciprocal associations > that are the same?? > > Hope this is useful - any questions, just should and thanks again for > your most timely coding :) > > Cheers > > Rupert > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "merb" 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/merb?hl=en -~----------~----~----~----~------~----~------~--~---
