“Tom isn’t wrong, I just wanted to make sure that nobody misunderstands
and starts doing stuff like messageobject.parent_id = parentobject.id”
Can someone explain to me why
messageobject.parent_id = parentobject.id
is incorrect? It seems to work, but I’m just curious as to why it’s bad.
For example… I may have passed the parent id through the url. Seems
odd that I would have to query the db to populate my parent object just
to make the association to the new child object when I could just add
the id to the child’s record.
Of course, if there’s a good reason not to do that, I’d really be
interested to know… I want to make sure I’m doing it right!