The phone has a lot of messages.
The email address is full of messages.
The message either belongs to the phone, or email, or not. Communication belongs_tois optional.
The following associations seem to work fine for this relationship:
- Phone model
has_many :messages - Email Model
has_many :messages - The message model has no
belongs_to :phones, :email
Is this good or is there some kind of correct way to specify the relationship "can_belong_to"?
source
share