diff --git a/app/assets/javascripts/discourse/controllers/discovery-sortable.js.es6 b/app/assets/javascripts/discourse/controllers/discovery-sortable.js.es6 index 077a53c6bba..df055c0868b 100644 --- a/app/assets/javascripts/discourse/controllers/discovery-sortable.js.es6 +++ b/app/assets/javascripts/discourse/controllers/discovery-sortable.js.es6 @@ -8,7 +8,8 @@ export const queryParams = { max_posts: { replace: true, refreshModel: true }, q: { replace: true, refreshModel: true }, tags: { replace: true }, - before: { replace: true, refreshModel: true} + before: { replace: true, refreshModel: true}, + bumped_before: { replace: true, refreshModel: true} }; // Basic controller options diff --git a/lib/topic_query.rb b/lib/topic_query.rb index 841c0393f83..4eb4999ab06 100644 --- a/lib/topic_query.rb +++ b/lib/topic_query.rb @@ -14,6 +14,7 @@ class TopicQuery @public_valid_options ||= %i(page before + bumped_before topic_ids exclude_category_ids category @@ -600,6 +601,12 @@ class TopicQuery end end + if bumped_before = options[:bumped_before] + if (bumped_before = bumped_before.to_i) > 0 + result = result.where('topics.bumped_at < ?', bumped_before.to_i.days.ago) + end + end + if status = options[:status] case status when 'open'