diaspora/app/assets/javascripts/app/models/status_message.js
2012-05-17 15:32:35 -07:00

19 lines
509 B
JavaScript

app.models.StatusMessage = app.models.Post.extend({
url : function(){
return this.isNew() ? '/status_messages' : '/posts/' + this.get("id");
},
defaults : {
'post_type' : 'StatusMessage',
'author' : app.currentUser ? app.currentUser.attributes : {}
},
toJSON : function(){
return {
status_message : _.clone(this.attributes),
aspect_ids : this.get("aspect_ids"),
photos : this.photos && this.photos.pluck("id"),
services : this.get("services")
}
}
});