Skip to content

Instantly share code, notes, and snippets.

@hameddk
hameddk / all-of-your-models.js
Created March 27, 2016 16:40 — forked from DesignByOnyx/all-of-your-models.js
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('properties', {
...
}, {
classMethods: {
// Create a static 'associate' method - will be called later
associate: function (models) {
Author.hasMany(models.Books, { as: 'books' });