itsme213 asked:

Og: object.save : what exactly is saved?

Tags:

What are the rules to determine all the objects that are saved when I call:

obj.save

Do these traverse relationships? Which ones?

If I have a graph of interconnected objects, does it matter in which order I #save them?

Will extra #save calls ever result in objects getting duplicated in the database?

(1 attempts)

Rayman answered:

AFAIK relationships are only saved on joinsmany relations (well, it's automatic really. joinsmany uses a join-table under the hood).

George once added a helper/feature to help the relation travelsal, but I can't remember it anymore -- for now, user should save the relation both ways manually

I'm waiting for automatic traversal of relations, especially for HasOne and BelongsTo relations. It's a pain to save the relations both ways, and even PAINIER to debug once you forget to do that XD

Rating: 0