-
-
Save geoffreyd/867660 to your computer and use it in GitHub Desktop.
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
Pharos360.Course = SC.Record.extend( | |
/** @scope Pharos360.Course.prototype */ { | |
primaryKey: 'number', | |
number: SC.Record.attr(Number), | |
title: SC.Record.attr(String), | |
credit_hours: SC.Record.attr(String), | |
days: SC.Record.attr(String), | |
start_time: SC.Record.attr(String), | |
finish_time: SC.Record.attr(String), | |
bldg: SC.Record.attr(String), | |
room: SC.Record.attr(String), | |
class_type: SC.Record.attr(String), | |
// The data hash needs to have: `faculty_uid: 4` | |
member: SC.Record.toOne('Pharos360.Member', { isMaster: NO, inverse: 'courses', key:'faculty_uid' }) | |
}); |
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
Pharos360.Member = SC.Record.extend( | |
/** @scope Pharos360.Member.prototype */ { | |
primaryKey: 'username', | |
username: SC.Record.attr(String), | |
fullname: SC.Record.attr(String), | |
email: SC.Record.attr(String), | |
// The datahash needs: `courses: [3,6,8]` | |
courses: SC.Record.toMany('Pharos360.Course', { isMaster: YES, inverse: 'member', key:'courses' }) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment