This project is archived and is in readonly mode.
accepts_nested_attributes_for broken after upgrade from 2.3.5 to 2.3.8
-
wout
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
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. -
ebrahim
I meant 2.3.8 in the first sentence.
-
wout
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
- 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 validations not called when model updating using nested attributes .