Created
March 12, 2011 21:33
-
-
Save topherfangio/867578 to your computer and use it in GitHub Desktop.
Problems with Associations
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), | |
faculty_uid: 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), | |
member: SC.Record.toOne('Pharos360.Member', { isMaster: NO, 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), | |
courses: SC.Record.toMany('Pharos360.Course', { isMaster: YES, inverse: 'member', key:'username' }) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment