From 5ab70ad962481a2169593b81d15f86d1ea99653d Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Sun, 17 Nov 2019 02:55:56 -0600 Subject: In the indexer, skip destroyed `Status` objects. --- lib/tasks/monsterfork.rake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/tasks/monsterfork.rake b/lib/tasks/monsterfork.rake index 11c5d86d9..00a0eaedb 100644 --- a/lib/tasks/monsterfork.rake +++ b/lib/tasks/monsterfork.rake @@ -11,7 +11,12 @@ namespace :monsterfork do ActiveRecord::Base.logger.silence do i += statuses.count statuses.each do |s| - s.update_column(:normalized_text, normalize_status(s, cache: false)) + begin + next if s.destroyed? + s.update_column(:normalized_text, normalize_status(s, cache: false)) + rescue rescue ActiveRecord::RecordNotFound + true + end end end end -- cgit