2015-02-03 01:18:45 +00:00
|
|
|
var Backbone = require('backbone');
|
|
|
|
var SeriesCollection = require('../../Series/SeriesCollection');
|
2014-02-01 22:07:30 +00:00
|
|
|
|
2015-02-03 01:18:45 +00:00
|
|
|
module.exports = Backbone.Model.extend({
|
2015-02-13 21:03:50 +00:00
|
|
|
|
|
|
|
//Hack to deal with Backbone 1.0's bug
|
|
|
|
initialize : function() {
|
|
|
|
this.url = function() {
|
2015-02-03 01:18:45 +00:00
|
|
|
return this.collection.url + '/' + this.get('id');
|
|
|
|
};
|
|
|
|
},
|
2015-02-13 21:03:50 +00:00
|
|
|
|
|
|
|
parse : function(model) {
|
2015-02-03 01:18:45 +00:00
|
|
|
model.series = SeriesCollection.get(model.seriesId);
|
|
|
|
return model;
|
|
|
|
}
|
|
|
|
});
|