mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 19:57:18 +08:00
FIX: Store Reviewable's force_review as a boolean. (#11219)
* FIX: Store Reviewable's force_review as a boolean. Using the `force_review` flag raises the score to hit the minimum visibility threshold. This strategy turned out to be ineffective on sites with a high number of flags, where these values could rapidly fluctuate. This change adds a `force_review` column on the reviewables table and modifies the `Reviewable#list_for` method to show these items when passing the `status: :pending` option, even if the score is not high enough. ReviewableQueuedPosts and ReviewableUsers are always created using this option.
This commit is contained in:
@ -180,8 +180,8 @@ RSpec.describe Reviewable, type: :model do
|
||||
before 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)
|
||||
@queued_post = Fabricate(:reviewable_queued_post, score: 0, target: post, force_review: true)
|
||||
@queued_user = Fabricate(:reviewable_user, score: 0, force_review: true)
|
||||
end
|
||||
|
||||
it 'includes queued posts when searching for pending reviewables' do
|
||||
|
Reference in New Issue
Block a user