Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let Doctor = bookshelf.Model.extend({
- patients: function() {
- return this.belongsToMany(Patient).through(Appointment);
- }
- });
- let Appointment = bookshelf.Model.extend({
- patient: function() {
- return this.belongsTo(Patient);
- },
- doctor: function() {
- return this.belongsTo(Doctor);
- }
- });
- let Patient = bookshelf.Model.extend({
- doctors: function() {
- return this.belongsToMany(Doctor).through(Appointment);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment