mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
FEATURE: New API to apply custom filters to the review queue (#8392)
This commit is contained in:
parent
fd0025a735
commit
c92f0b8775
7 changed files with 74 additions and 11 deletions
|
@ -663,6 +663,15 @@ class Plugin::Instance
|
|||
File.exists?(js_file_path)
|
||||
end
|
||||
|
||||
# Receives an array with two elements:
|
||||
# 1. A symbol that represents the name of the value to filter.
|
||||
# 2. A Proc that takes the existing ActiveRecord::Relation and the value received from the front-end.
|
||||
def add_custom_reviewable_filter(filter)
|
||||
reloadable_patch do
|
||||
Reviewable.add_custom_filter(filter)
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def self.js_path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue