# 如何在插件中在评论页面主题上使用 topic\_query.rb 中的 apply\_custom\_query

**URL:** <https://meta.discourse.org/t/how-to-use-apply-custom-query-from-topic-query-rb-on-review-page-topics-in-plugin/131590>\
**Category:** Development\
**Created:** [2019 年10 月 21 日 21:23 UTC](https://meta.discourse.org/t/how-to-use-apply-custom-query-from-topic-query-rb-on-review-page-topics-in-plugin/131590 "2019-10-21T21:23:23Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

作者： ![Oliver\_Walker](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/oliver_walker/32/155432_2.png) [@Oliver\_Walker](https://meta.discourse.org/u/Oliver_Walker)\
发布日期： [2019 年10 月 22 日 15:58 UTC](https://meta.discourse.org/t/how-to-use-apply-custom-query-from-topic-query-rb-on-review-page-topics-in-plugin/131590/2 "2019-10-22T15:58:51Z")

</div>

我想我在开始探索这个主题查询路径时搞砸了，因为看起来 reviewables 甚至没有使用那些主题查询函数，所以我无法通过这种方式应用自定义过滤器。

另外，我对 apply\_custom\_filters 的参数仍然有些困惑。results 是指主题的 Ruby 哈希吗？topic\_query 是否只是该类的一个实例？

接下来，我不确定这是否是正确的做法，但我会尝试找出如何覆盖 reviewables\_controller#index 函数，以便根据当前用户从 reviewables 列表中移除某些主题。

如果您能提供一些建议和指导就太好了 🙂

---

_[View the full topic](https://meta.discourse.org/t/how-to-use-apply-custom-query-from-topic-query-rb-on-review-page-topics-in-plugin/131590)._
