mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: We don't create a Post object if the queued post gets rejected. We need to count review items directly. (#9856)
This commit is contained in:
@@ -1115,10 +1115,9 @@ class User < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def number_of_rejected_posts
|
||||
Post.with_deleted
|
||||
.where(user_id: self.id)
|
||||
.joins('INNER JOIN reviewables r ON posts.id = r.target_id')
|
||||
.where(r: { status: Reviewable.statuses[:rejected], type: ReviewableQueuedPost.name })
|
||||
ReviewableQueuedPost
|
||||
.where(status: Reviewable.statuses[:rejected])
|
||||
.where(created_by_id: self.id)
|
||||
.count
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user