mirror of
https://github.com/mastodon/mastodon.git
synced 2025-01-03 15:52:34 +01:00
Replace Oj
with plain JSON
across db/
This commit is contained in:
parent
f0895c8316
commit
4ee2b57e5d
5 changed files with 6 additions and 6 deletions
|
@ -28,7 +28,7 @@ class RejectFollowingBlockedUsers < ActiveRecord::Migration[5.2]
|
|||
|
||||
next follow.destroy! if blocked_account.local?
|
||||
|
||||
reject_follow_json = Oj.dump(ActivityPub::LinkedDataSignature.new(ActiveModelSerializers::SerializableResource.new(follow, serializer: ActivityPub::RejectFollowSerializer, adapter: ActivityPub::Adapter).as_json).sign!(followed_account))
|
||||
reject_follow_json = JSON.dump(ActivityPub::LinkedDataSignature.new(ActiveModelSerializers::SerializableResource.new(follow, serializer: ActivityPub::RejectFollowSerializer, adapter: ActivityPub::Adapter).as_json).sign!(followed_account))
|
||||
|
||||
ActivityPub::DeliveryWorker.perform_async(reject_follow_json, followed_account, blocked_account.inbox_url)
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ class MoveUserSettings < ActiveRecord::Migration[6.1]
|
|||
end
|
||||
end
|
||||
|
||||
user.update_column('settings', Oj.dump(user_settings))
|
||||
user.update_column('settings', JSON.dump(user_settings))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -21,7 +21,7 @@ class MigrateInteractionSettingsToPolicy < ActiveRecord::Migration[7.1]
|
|||
private
|
||||
|
||||
def policy_for_user(user)
|
||||
deserialized_settings = Oj.load(user.attributes_before_type_cast['settings'])
|
||||
deserialized_settings = JSON.parse(user.attributes_before_type_cast['settings'])
|
||||
return if deserialized_settings.nil?
|
||||
|
||||
requires_new_policy = false
|
||||
|
|
|
@ -11,11 +11,11 @@ class FixKmrLocaleSettings < ActiveRecord::Migration[7.0]
|
|||
MigrationUser.reset_column_information
|
||||
|
||||
MigrationUser.where.not(settings: [nil, '{}']).find_each do |user|
|
||||
user_settings = Oj.load(user.settings)
|
||||
user_settings = JSON.parse(user.settings)
|
||||
next unless user_settings['default_language'] == 'kmr'
|
||||
|
||||
user_settings['default_language'] = 'ku'
|
||||
user.update!(settings: Oj.dump(user_settings))
|
||||
user.update!(settings: JSON.dump(user_settings))
|
||||
end
|
||||
|
||||
MigrationUser.where.not(chosen_languages: nil).where('chosen_languages && ?', '{kmr}').find_each do |user|
|
||||
|
|
|
@ -21,7 +21,7 @@ class MigrateInteractionSettingsToPolicyAgain < ActiveRecord::Migration[7.1]
|
|||
private
|
||||
|
||||
def policy_for_user(user)
|
||||
deserialized_settings = Oj.load(user.attributes_before_type_cast['settings'])
|
||||
deserialized_settings = JSON.parse(user.attributes_before_type_cast['settings'])
|
||||
return if deserialized_settings.nil?
|
||||
return if user.notification_policy.present?
|
||||
|
||||
|
|
Loading…
Reference in a new issue