scinote-web/db/migrate/20231122125004_fix_notification_migration.rb

10 lines
299 B
Ruby
Raw Normal View History

2023-11-22 20:52:27 +08:00
class FixNotificationMigration < ActiveRecord::Migration[7.0]
def up
Notification.find_each do |notification|
parsed_params = JSON.parse(notification.params)
parsed_params.delete('_aj_symbol_keys')
2023-11-22 22:21:01 +08:00
notification.update!(params: parsed_params.symbolize_keys)
2023-11-22 20:52:27 +08:00
end
end
end