diff options
-rw-r--r-- | lib/tasks/monsterfork.rake | 7 |
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 |