Forum: Ruby on Rails ActiveRecords: save & relationships

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.
Andre P. (Guest)
on 2005-12-22 22:27
Dear all,

How many steps does 'save method' save in has_many/belongs_to
relationships ?

Just to exemplify,  let's suppose:

School  has_many Classes
Classes has_many Students   = 'school'    = 'class' = 'student1' = 'student2'

Class.students << Student1
Class.students << Student2
School.Classes << Class

Should i have everything saved in the database ?
In a real situation, i'm having students with null class_id's.
Is that ok ?

Many thanks,
This topic is locked and can not be replied to.