Skip to content

Instantly share code, notes, and snippets.

@DesignByOnyx
DesignByOnyx / all-of-your-models.js
Last active June 16, 2016 22:39
Adjust feathersjs with sequelize to allow models to set up relationships
// Only showing relevant changes
// The folllowing changes must be made in all of your models
var Author = sequelize.define('Authors', {
...
}, {
classMethods: {
// Create a static 'associate' method - will be called later
associate: function (models) {
Author.hasMany(models.Books, { as: 'books' });