20180327170847_issue_1905_exchange_login_from_remote_id.rb 556 B

12345678910111213141516171819
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Issue1905ExchangeLoginFromRemoteId < ActiveRecord::Migration[5.1]
  3. def change
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. config = Import::Exchange.config
  7. return if config.blank?
  8. return if config[:attributes].blank?
  9. return if config[:attributes][:item_id].blank?
  10. return if config[:attributes][:item_id] != 'login'
  11. config[:attributes].delete(:item_id)
  12. Import::Exchange.config = config
  13. end
  14. end