Lille
2010-Oct-11 14:32 UTC
is there one command to save an ActiveRecord and all dependents?
Hi, When testing, I sometimes modify a parent object, save it, but then get tripped up bc the dependents do not reflect the change (maybe that should be obvious.) I''m wondering, is there a command that saves an ActiveRecord instance and all its dependents? Thanks, Lille -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
radhames brito
2010-Oct-11 14:39 UTC
Re: is there one command to save an ActiveRecord and all dependents?
you can call save on the childs but there is also this method accepts_nested_attributes_for :child thats how is was called in rails 2 try finding out if its called the same in rails 3. instead of child put the name of the child model -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Colin Law
2010-Oct-11 15:04 UTC
Re: is there one command to save an ActiveRecord and all dependents?
On 11 October 2010 15:32, Lille <lille.penguini-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > When testing, I sometimes modify a parent object, save it, but then > get tripped up bc the dependents do not reflect the change (maybe that > should be obvious.) > > I''m wondering, is there a command that saves an ActiveRecord instance > and all its dependents?Why should you need to save the dependents if it is only the parent that you have modified? Colin -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
radhames brito
2010-Oct-11 15:08 UTC
Re: is there one command to save an ActiveRecord and all dependents?
@colin I think he wants to change a child with fields_for and but my not be aware that the method exist, its the only way i can make sense out of his question -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.