Fernando Perez wrote:

> If you are concerned with the 15 loc added to the model for the 
> new_whatever_attribute= and so on, well actually using metaprogramming, 
> you easily extract this into a plugin and share the code between various 
> models. I think I will follow this path instead of using rails' builtin 
> nested form support.

Having looked at it overnight I can see that the new stuff in 2.3 treats 
habtm just like hm. So that if for example you have many users and many 
roles and many-to-many relationship between them and you try to use the 
new stuff to add a role to a user from a select list it will add a copy 
of the role to the roles table. If you've got a unique index on the non 
id identifier, like the name, then you'll be in trouble.

It will also issue updates to things it shouldn't. I've cleaned it out 
of my code.

But the jscript stuff in the examples for adding new records is quite 
useful, I'm fiddling with it now to make it work with old-style nested 
forms for adding m-2-m links.

John Small


-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to