Kye
2007-Feb-27 16:48 UTC
a child object saved to database just by appending to a parent before saving
Hi all, I just observed an unexpected behavior of saving. I need some help. I am using Rails 1.2 and mysql 5.xx. I created a child object, then appended to a parent object. That is, child = Child.new parent.children << child Before I do, parent.save, I looked at the database table. this child object row is alredy created there in the child table. The relationship is quite simple Parent has_many :children Child belongs_to :parent, :dependent => :nullify Thank you for any comment Kye --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---