1
0
mirror of https://github.com/flarum/core.git synced 2025-07-31 13:40:20 +02:00

Change the way post count metadata is stored

We care about the number of “comment” posts, not the number of posts in
total.
This commit is contained in:
Toby Zerner
2015-01-16 17:10:54 +10:30
parent cfdf01ec70
commit 5e288f55f5
7 changed files with 17 additions and 17 deletions

View File

@@ -24,10 +24,10 @@ var Discussion = DS.Model.extend({
relevantPosts: DS.hasMany('post'),
postsCount: DS.attr('number'),
commentsCount: DS.attr('number'),
repliesCount: function() {
return Math.max(0, this.get('postsCount') - 1);
}.property('postsCount'),
return Math.max(0, this.get('commentsCount') - 1);
}.property('commentsCount'),
posts: DS.attr('string'),
postIds: function() {