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:
@@ -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() {
|
||||
|
Reference in New Issue
Block a user