diaspora/public/javascripts/app/models/post.js
danielgrippi ae6fa5bebb don't use Diaspora widget system or stream.js when backbone is active;
migrating like actions over to backbone; some cleanup; bump jquery to
1.7.1
2012-01-07 14:23:22 -08:00

14 lines
354 B
JavaScript

App.Models.Post = Backbone.Model.extend({
url: function(){
return "/posts/" + this.get("id");
},
initialize: function() {
this.comments = new App.Collections.Comments(this.get("last_three_comments"));
this.likes = new App.Collections.Likes();
},
createdAt: function(){
return +new Date(this.get("created_at")) / 1000;
}
});