According to the documentation for NestedAttributes<http://api.rubyonrails.org/classes/ActiveRecord/NestedAttributes/ClassMethods.html>, when you have an associated model that is marked for destruction and you call save on the parent it should not be required to call reload in order to see that change reflected on the object''s association in memory (it''s at the end of the One-to-many section). However, the documentation for AutosaveAssociation<http://api.rubyonrails.org/classes/ActiveRecord/AutosaveAssociation.html>contradicts; showing that it is required to call reload in order to see the change to the association (see the One-to-many Example). My feeling is that this is a documentation error in NestedAttributes since the real behavior is that you do have to call reload. Although, it would be nicer if users did not have to remember to call reload as that would go along with the principle of least surprise. If someone can confirm a documentation change is appropriate I will go ahead and submit a patch to docrails. Rob Olson --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
> My feeling is that this is a documentation error in NestedAttributes > since the real behavior is that you do have to call reload.Indeed.> Although, it would be nicer if users did not have to remember to > call reload as that would go along with the principle of least > surprise.Maybe, I can''t remember any case where I needed that though. But anyways, it''s unrelated to NestedAttributes or AutosaveAssociation, it''s just the way AR has worked for ever afaik. So if you''d like to change that, please create a ticket for it or start a new discussion.> If someone can confirm a documentation change is appropriate I will > go ahead and submit a patch to docrails.Yes, please do create a doc patch! :) Thanks, Eloy --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---