fix ruby reshare model; extract sortOrder in app.models.Stream.

This commit is contained in:
danielgrippi 2012-02-06 08:26:11 -08:00
parent fa5424653a
commit de757db48b
2 changed files with 6 additions and 3 deletions

View file

@ -42,7 +42,7 @@ class Reshare < Post
end end
def photos def photos
self.root ? root.photos : super self.root ? root.photos : nil
end end
def receive(recipient, sender) def receive(recipient, sender)

View file

@ -47,8 +47,11 @@ app.models.Stream = Backbone.Collection.extend({
maxTime: function(){ maxTime: function(){
var lastPost = _.last(this.posts.models); var lastPost = _.last(this.posts.models);
var isOnParticipateStream = this.basePath().match(/participate/); return lastPost[this.sortOrder()]()
return (isOnParticipateStream == null) ? lastPost.createdAt() : lastPost.interactedAt(); },
sortOrder : function() {
return this.basePath().match(/participate/) ? "interactedAt" : "createdAt"
}, },
add : function(models){ add : function(models){