Last active
December 30, 2016 05:43
-
-
Save AskYous/0ccaec850d30e7069afe9472c453cc33 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/** | |
* Classes.js | |
* | |
* @description :: TODO: You might write a short summary of how this model works and what it represents here. | |
* @docs :: http://sailsjs.org/documentation/concepts/models-and-orm/models | |
*/ | |
module.exports = { | |
attributes: { | |
'number': { 'type': 'string' }, | |
'name': { 'type': 'string' }, | |
'sessions': { | |
'collection': 'sessions', // collection: <table name> | |
'via': 'classes', | |
'through': 'classsession' | |
} | |
} | |
}; | |
/** | |
* ClassSession.js | |
* | |
* @description :: TODO: You might write a short summary of how this model works and what it represents here. | |
* @docs :: http://sailsjs.org/documentation/concepts/models-and-orm/models | |
*/ | |
module.exports = { | |
attributes: { | |
'classes': { 'model': 'classes', 'required': true }, | |
'sessions': { 'model': 'sessions', 'required': true }, | |
'name': { 'type': 'string' } | |
} | |
}; | |
/** | |
* Sessions.js | |
* | |
* @description :: TODO: You might write a short summary of how this model works and what it represents here. | |
* @docs :: http://sailsjs.org/documentation/concepts/models-and-orm/models | |
*/ | |
module.exports = { | |
attributes: { | |
'startDateTime': { 'type': 'datetime' }, | |
'endDateTime': { 'type': 'datetime' }, | |
'name': { 'type': 'string' }, | |
'classes':{ | |
'collection': 'classes', | |
'via': 'sessions', | |
'through': 'classsession' | |
} | |
} | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment