From 452237335bdaa8fd2a6d6bf16efe64978ea4d9b1 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Thu, 12 Dec 2019 04:23:04 -0600 Subject: make reindex tasks using new normalized text table --- lib/tasks/monsterfork.rake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/tasks/monsterfork.rake b/lib/tasks/monsterfork.rake index 6c2f5074a..d7b25de78 100644 --- a/lib/tasks/monsterfork.rake +++ b/lib/tasks/monsterfork.rake @@ -13,7 +13,12 @@ def index_statuses(statuses_query) statuses.each do |s| begin next if s.destroyed? - s.update_column(:normalized_text, normalize_status(s)) + normalized_text = normalize_status(s) + if s.normalized_status.nil? + s.create_normalized_status(text: normalized_text) + else + s.normalized_status.update_column(:text, normalized_text) + end rescue ActiveRecord::RecordNotFound true end -- cgit