From bc81d32c2caa5a53b3326421bd8ffdb2fd4a3491 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Tue, 3 Dec 2019 17:04:32 -0600 Subject: when someone adds/changes a filter retroactively apply it to their home & list timelines --- app/models/custom_filter.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'app/models/custom_filter.rb') diff --git a/app/models/custom_filter.rb b/app/models/custom_filter.rb index a90b99c48..67d1a0bea 100644 --- a/app/models/custom_filter.rb +++ b/app/models/custom_filter.rb @@ -18,4 +18,19 @@ class CustomFilter < ApplicationRecord belongs_to :account validates :phrase, presence: true + + after_save :update_feeds + after_save :remove_cache + + private + + def update_feeds + FilterFeedsWorker.perform_async(account_id) + end + + private + + def remove_cache + redis.del("filtered_statuses:#{account_id}") + end end -- cgit