diff --git a/db/migrate/20210728103633_move_auth_backends_to_database.rb b/db/migrate/20210728103633_move_auth_backends_to_database.rb index 64a8709d3..8fd006f3a 100644 --- a/db/migrate/20210728103633_move_auth_backends_to_database.rb +++ b/db/migrate/20210728103633_move_auth_backends_to_database.rb @@ -18,7 +18,7 @@ class MoveAuthBackendsToDatabase < ActiveRecord::Migration[6.0] }, state: { priority: 1, - adapter: 'Auth::Internal', + adapter: 'Auth::Backend::Internal', }, frontend: false ) @@ -34,20 +34,29 @@ class MoveAuthBackendsToDatabase < ActiveRecord::Migration[6.0] }, state: { priority: 2, - adapter: 'Auth::Developer', + adapter: 'Auth::Backend::Developer', }, frontend: false ) + update_auth_ldap + end + + private + + def update_auth_ldap # rubocop:disable Metrics/AbcSize + begin auth_ldap = Setting.find_by(name: 'auth_ldap') auth_ldap.state_initial[:value][:priority] = 3 + auth_ldap.state_initial[:value][:adapter] = 'Auth::Backend::Ldap' auth_ldap.state_current[:value][:priority] = 3 + auth_ldap.state_current[:value][:adapter] = 'Auth::Backend::Ldap' auth_ldap.save! rescue => e - Rails.logger.error "Error while updating 'auth_ldap' Setting priority" + Rails.logger.error "Error while updating 'auth_ldap' Setting priority and adapter" Rails.logger.error e end end