ActiveRecords: save & relationships

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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs