about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-12-12 04:23:04 -0600
committermultiple creatures <dev@multiple-creature.party>2019-12-12 04:23:04 -0600
commit452237335bdaa8fd2a6d6bf16efe64978ea4d9b1 (patch)
treec8c824a97d19abc5112d2e572f8f32ac60875dce /lib
parentdd7e1fb2b05419b74b5bf7326ae9844849e32e95 (diff)
make reindex tasks using new normalized text table
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/monsterfork.rake7
1 files changed, 6 insertions, 1 deletions
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