mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-18 23:21:30 +08:00
24 lines
804 B
Ruby
24 lines
804 B
Ruby
# frozen_string_literal: true
|
|
|
|
class MigrateNotificationSettings < ActiveRecord::Migration[7.0]
|
|
def up
|
|
User.find_each do |user|
|
|
user.settings[:notifications_settings] =
|
|
user.settings[:notifications_settings].merge(Extends::DEFAULT_USER_NOTIFICATION_SETTINGS)
|
|
|
|
user.settings[:notifications_settings][:project_experiment_access] = {
|
|
in_app: user.settings.dig(:notifications_settings, :assignments),
|
|
email: user.settings.dig(:notifications_settings, :assignments_email)
|
|
}
|
|
|
|
user.settings[:notifications_settings][:other_team_invitation] = {
|
|
in_app: user.settings.dig(:notifications_settings, :assignments),
|
|
email: user.settings.dig(:notifications_settings, :assignments_email)
|
|
}
|
|
|
|
user.save!
|
|
end
|
|
end
|
|
|
|
def down; end
|
|
end
|