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
def photos
self.root ? root.photos : super
self.root ? root.photos : nil
end
def receive(recipient, sender)

View file

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