mirror of
https://gitlab.com/Alamantus/Readlebee.git
synced 2025-05-20 17:11:15 +02:00
23 lines
No EOL
432 B
JavaScript
23 lines
No EOL
432 B
JavaScript
module.exports = models => {
|
|
const {
|
|
BookReference,
|
|
Review,
|
|
} = models;
|
|
|
|
BookReference.hasMany(Review, {
|
|
as: 'Interactions',
|
|
foreignKey: 'bookReferenceId',
|
|
});
|
|
|
|
BookReference.hasMany(Review.scope('Text'), {
|
|
as: 'Reviews',
|
|
foreignKey: 'bookReferenceId',
|
|
});
|
|
|
|
BookReference.hasMany(Review.scope('Rating'), {
|
|
as: 'Ratings',
|
|
foreignKey: 'bookReferenceId',
|
|
});
|
|
|
|
return BookReference;
|
|
} |