trabajo-afectivo/db/migrate/20211028072158_maintenance_remove_active_ldap_sessions.rb
2022-01-01 14:38:12 +01:00

12 lines
386 B
Ruby

# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
class MaintenanceRemoveActiveLdapSessions < ActiveRecord::Migration[6.0]
def change
return if !Setting.exists?(name: 'system_init_done')
# Only relevant for when ldap integration is used.
return if !Setting.get('ldap_integration')
ActiveRecord::SessionStore::Session.destroy_all
end
end