Skip to content
Browse files

FEATURE: support filter_auto_bump_topics event

Use this event to filter the list of auto bumped topics.


  on(:filter_auto_bump_topics) do |_category, filters|
    filters.push(->(r) { r.where(<<~SQL)
        NOT EXISTS(
          SELECT 1 FROM topic_custom_fields
          WHERE topic_id =
          AND name = 'accepted_answer_post_id'
  • Loading branch information
SamSaffron committed Jul 18, 2018
1 parent 0262888 commit 5adf5b527de97a1cc30c5eb699dd45dd6d247595
Showing with 12 additions and 1 deletion.
  1. +12 −1 app/models/category.rb
@@ -410,7 +410,18 @@ def auto_bump_topic!
limiter = auto_bump_limiter
return false if !limiter.can_perform?

topic = Topic
filters = []
DiscourseEvent.trigger(:filter_auto_bump_topics, self, filters)

relation = Topic

if filters.length > 0
filters.each do |filter|
relation =

topic = relation

1 comment on commit 5adf5b5


This comment has been minimized.

Copy link

discoursebot commented on 5adf5b5 Jul 18, 2018

This commit has been mentioned on Discourse Meta. There might be relevant details there:

Please sign in to comment.
You can’t perform that action at this time.