trabajo-afectivo/db/migrate/20200617153806_issue_3087_search_taskbar_deadlock.rb

17 lines
428 B
Ruby
Raw Normal View History

2022-01-01 13:38:12 +00:00
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
class Issue3087SearchTaskbarDeadlock < ActiveRecord::Migration[5.2]
def change
Taskbar.where(key: 'Search').find_each do |taskbar|
next if taskbar.preferences.blank?
next if taskbar.preferences[:tasks].blank?
taskbar.preferences.delete(:tasks)
taskbar.save!
rescue => e
Rails.logger.error e
end
end
end