Created
June 26, 2014 16:26
-
-
Save tobius/16ad7ea2648fac90e088 to your computer and use it in GitHub Desktop.
example of user and role associations in sails.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// user.js | |
module.exports = { | |
schema: true, | |
attributes: { | |
name: { | |
type: 'string', | |
required: true | |
}, | |
roles: { | |
collection: 'role', | |
required: false | |
} | |
} | |
}; | |
// role.js | |
module.exports = { | |
schema: true, | |
attributes: { | |
name: { | |
type: 'string', | |
required: true | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment