I'm trying to use sequelizejs 1.4, and after reading the docs, am still confused about associations.
var User = sequelize.define('User', {/* ... /}) var Project = sequelize.define('Project', {/ ... */})
Project.hasOne(User)
do I have to include this code every time ? I was trying to separate out the models to single files, but looking at this makes me think that I need to have user defined in the project model.
Or, do I need to associate the models at a higher level ?
p1 = new Project() u1 = new User()
p1.hasOne(u1)
just doesn't seem right to me. I know that I must be missing something obvious, and just need someone to pull the switch that turns on the light :)
Thanks