Forum: Ruby on Rails a child object saved to database just by appending to a pare

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Kye (Guest)
on 2007-02-27 18:49
(Received via mailing list)
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 =
parent.children << child

Before I do,, I looked at the database table.
this child object row is alredy created there in the child table.

The relationship is quite simple

has_many :children

belongs_to :parent, :dependent => :nullify

Thank you for any comment

This topic is locked and can not be replied to.