This project is archived and is in readonly mode.
accepts_nested_attributes_for broken after upgrade from 2.3.5 to 2.3.8
Reported by wout | June 22nd, 2010 @ 07:59 PM
Hi,
accepts_nested_attributes_for :association is broken in one of my apps after upgrading to 2.3.8. The model itself is saved but the associations are not. I tried all different setups for the nested forms but it is definitely broken. For the time being I'm saving the associations separately.
Wout
Comments and changes to this ticket
-
wout June 27th, 2010 @ 09:44 AM
I'v done some tests on three applications which all use nested forms. They were at 2.3.5 and I upgraded to 2.3.8. Now they all have the same symptoms, associations are saved on create but aren't saved on update.
-
ebrahim July 10th, 2010 @ 03:24 PM
I've got a similar problem with Rails 2.3.5. This is my model: http://bitbucket.org/ebrahim/siva/src/a22fe3913315/app/models/word.rb
If I uncomment the commented validates_size_of validation, no more child WordForm objects of word_forms are destroyed when they receive _destroy=1 attribute, and no error is reported. When that validation is commented, everything works as intended.
I also checked in console: destroying some WordForm of a_word.word_forms does nothing and reports no errors.
I also tried rewriting validate_size_of using a custom validation, but behavior was the same.
I went back to Rails 2.3.5 and everything worked again, with validates_size_of enabled. -
wout July 10th, 2010 @ 03:39 PM
Thank you for noticing me about it.
Commenting out the size validator did the trick indeed.I'm bumping all apps to Rails 3 anyway.
I'l check if the same bug appears there. -
Neeraj Singh July 10th, 2010 @ 05:14 PM
- State changed from new to duplicate
- Importance changed from to Low
@wout Rails3 has same issue with size validation.
This ticket is duplicate of #2646 .
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>