In the case of relating 2 models, I'm not sure which model to add the reference to, or to add references to both.
Take the auto generated models for example:
The user model has a hasMany
reference to accessToken
, but the accessToken
does not have a belongsTo
reference to the user model.
Is it the case that the relation only goes on one side, and that side depends on if it's a 1 to 1 or a 1 to many? If not, please help me understand how to determine where to apply references in the loopback model architecture.