Open Shenrak opened 7 years ago
To be frank... I didn't test that code. It was just to have the logic somewhere in the code. Just change the code to:
Chat.belongsTo(User, 'user1', 'private.idUser1', 'id')
Chat.belongsTo(User, 'user2', 'private.idUser2', 'id')
And it should work
What is exactly the purpose to that code ? Make private chats between two users ?
Yup, that's it. I tried to do some kind of subclassing straight from the model, but it might not be a good workaround...
@justinrlle I have a bug generated by your code in model relations
Gives me an error
Error: The field 'user' is already used by another relation.
That is quite new as i createdindex.js
in app/models.I'm surprised that that code worked before actually. Any idea ?