Mike
unread,Aug 11, 2011, 3:26:25 PM8/11/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to JazzRecord
When using hasAndBelongsToMany is there a method for adding additional
data to the intermediary (mapping) table?
For instance from the example you provide of student and high school
class if you wanted to store the date enrolled, date completed, or
grades wouldn't they most likely be stored in the joining (mapping)
table?
var HighSchoolClass = new JazzRecord.Model({
table: "high_school_classes",
foreignKey: "high_school_class_id",
hasAndBelongsToMany: { students: "students"},
columns: {
name: "text",
room: "number"
}
});
var Student = new JazzRecord.Model({
table: "students",
foreignKey: "student_id",
belongsTo: { home: "homes"},
hasAndBelongsToMany: { classes: "high_school_classes"},
columns: {
name: "text",
grade: "text",
home_id: "number"
}
});