0
0
Fork 0

Fix notification policy migration not preserving filter_private_mentions correctly (#29699)

This commit is contained in:
Claire 2024-03-21 22:52:29 +01:00 committed by GitHub
parent 142c018cfa
commit 70a8fcf07d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 65 additions and 4 deletions

View file

@ -105,6 +105,12 @@ namespace :tests do
exit(1)
end
policy = NotificationPolicy.find_by(account: User.find(1).account)
unless policy.filter_private_mentions == false && policy.filter_not_following == true
puts 'Notification policy not migrated as expected'
exit(1)
end
puts 'No errors found. Database state is consistent with a successful migration process.'
end
@ -181,7 +187,8 @@ namespace :tests do
INSERT INTO "settings"
(id, thing_type, thing_id, var, value, created_at, updated_at)
VALUES
(5, 'User', 4, 'default_language', E'--- kmr\n', now(), now());
(5, 'User', 4, 'default_language', E'--- kmr\n', now(), now()),
(6, 'User', 1, 'interactions', E'--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\nmust_be_follower: false\nmust_be_following: true\nmust_be_following_dm: false\n', now(), now());
SQL
end