mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-29 10:49:04 +01:00
Fix interaction settings migration error when encountering no settings (#29529)
This commit is contained in:
parent
e8605a69d2
commit
e85a2aa18d
1 changed files with 3 additions and 0 deletions
|
@ -20,6 +20,9 @@ class MigrateInteractionSettingsToPolicy < ActiveRecord::Migration[7.1]
|
||||||
def up
|
def up
|
||||||
User.includes(account: :notification_policy).find_each do |user|
|
User.includes(account: :notification_policy).find_each do |user|
|
||||||
deserialized_settings = Oj.load(user.attributes_before_type_cast['settings'])
|
deserialized_settings = Oj.load(user.attributes_before_type_cast['settings'])
|
||||||
|
|
||||||
|
next if deserialized_settings.nil?
|
||||||
|
|
||||||
policy = user.account.notification_policy || user.account.build_notification_policy
|
policy = user.account.notification_policy || user.account.build_notification_policy
|
||||||
requires_new_policy = false
|
requires_new_policy = false
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue