From ee27b56ed15b2b18e7d64ed4161c7ed5fa8796b2 Mon Sep 17 00:00:00 2001 From: Chris Oliver Date: Thu, 18 Jan 2024 09:57:28 -0600 Subject: [PATCH] Update UPGRADE.md --- UPGRADE.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index 55034f95..f12d948f 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -28,10 +28,12 @@ end # Migrate each record to the new tables Notification.find_each do |notification| - attributes = notification.attributes.slice("id", "type") - attributes[:type] = attributes[:type].sub("Notification", "Notifier")) + attributes = notification.attributes.slice("id", "type").with_indifferent_access + attributes[:type] = attributes[:type].sub("Notification", "Notifier") attributes[:params] = Noticed::Coder.load(notification.params) + attributes[:params] = {} if attributes[:params].try(:has_key?, "noticed_error") # Skip invalid records attributes[:notifications_attributes] = [{ + type: "#{attributes[:type]}::Notification", recipient_type: notification.recipient_type, recipient_id: notification.recipient_id, read_at: notification.read_at,