|
|
@ -24,7 +24,6 @@
|
|
|
|
defaults: function() {
|
|
|
|
defaults: function() {
|
|
|
|
var timestamp = new Date().getTime();
|
|
|
|
var timestamp = new Date().getTime();
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
image : '/images/default.png',
|
|
|
|
|
|
|
|
unreadCount : 0,
|
|
|
|
unreadCount : 0,
|
|
|
|
timestamp : timestamp,
|
|
|
|
timestamp : timestamp,
|
|
|
|
active_at : timestamp
|
|
|
|
active_at : timestamp
|
|
|
@ -36,7 +35,7 @@
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
validate: function(attributes, options) {
|
|
|
|
validate: function(attributes, options) {
|
|
|
|
var required = ['type', 'timestamp', 'image'];
|
|
|
|
var required = ['type', 'timestamp'];
|
|
|
|
var missing = _.filter(required, function(attr) { return !attributes[attr]; });
|
|
|
|
var missing = _.filter(required, function(attr) { return !attributes[attr]; });
|
|
|
|
if (missing.length) { return "Conversation must have " + missing; }
|
|
|
|
if (missing.length) { return "Conversation must have " + missing; }
|
|
|
|
},
|
|
|
|
},
|
|
|
|