20180327170847_issue_1905_exchange_login_from_remote_id.rb 479 B

1234567891011121314151617
  1. class Issue1905ExchangeLoginFromRemoteId < ActiveRecord::Migration[5.1]
  2. def change
  3. # return if it's a new setup
  4. return if !Setting.find_by(name: 'system_init_done')
  5. config = Import::Exchange.config
  6. return if config.blank?
  7. return if config[:attributes].blank?
  8. return if config[:attributes][:item_id].blank?
  9. return if config[:attributes][:item_id] != 'login'
  10. config[:attributes].delete(:item_id)
  11. Import::Exchange.config = config
  12. end
  13. end