FEATURE: New API to apply custom filters to the review queue (#8392)

This commit is contained in:
Roman Rizzi
2019-11-22 16:33:10 -03:00
committed by GitHub
parent fd0025a735
commit c92f0b8775
7 changed files with 74 additions and 11 deletions

View File

@ -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