mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Include pending queued users regardless of their score (#9372)
This commit is contained in:
parent
3e176f9bf4
commit
e52e7f6e75
@ -476,7 +476,10 @@ class Reviewable < ActiveRecord::Base
|
||||
result = result.where("created_at <= ?", to_date) if to_date
|
||||
|
||||
if min_score > 0 && status == :pending && type.nil?
|
||||
result = result.where("score >= ? OR type = ?", min_score, ReviewableQueuedPost.name)
|
||||
result = result.where(
|
||||
"score >= ? OR type IN (?)",
|
||||
min_score, [ReviewableQueuedPost.name, ReviewableUser.name]
|
||||
)
|
||||
elsif min_score > 0
|
||||
result = result.where("score >= ?", min_score)
|
||||
end
|
||||
|
@ -181,10 +181,11 @@ RSpec.describe Reviewable, type: :model do
|
||||
SiteSetting.reviewable_default_visibility = :high
|
||||
Reviewable.set_priorities(high: 10)
|
||||
@queued_post = Fabricate(:reviewable_queued_post, score: 0, target: post)
|
||||
@queued_user = Fabricate(:reviewable_user, score: 0)
|
||||
end
|
||||
|
||||
it 'includes queued posts when searching for pending reviewables' do
|
||||
expect(Reviewable.list_for(user)).to contain_exactly(@queued_post)
|
||||
expect(Reviewable.list_for(user)).to contain_exactly(@queued_post, @queued_user)
|
||||
end
|
||||
|
||||
it 'excludes pending queued posts when applying a different status filter' do
|
||||
|
Loading…
Reference in New Issue
Block a user