Skip to content

Commit

Permalink
Support psych 4+. Go back to upstream when
Browse files Browse the repository at this point in the history
cschiewek#276

is merged.
  • Loading branch information
lostmahbles authored and Bryan Marble committed Apr 15, 2022
1 parent 6ef2131 commit f037d59
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/devise_ldap_authenticatable/ldap/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ def initialize(params = {})
if ::Devise.ldap_config.is_a?(Proc)
ldap_config = ::Devise.ldap_config.call
else
ldap_config = YAML.load(ERB.new(File.read(::Devise.ldap_config || "#{Rails.root}/config/ldap.yml")).result)[Rails.env]
source = ERB.new(File.read(::Devise.ldap_config || "#{Rails.root}/config/ldap.yml")).result
begin
ldap_config = YAML.load(source, aliases: true)[Rails.env]
rescue ArgumentError
ldap_config = YAML.load(source)[Rails.env]
end
end
ldap_options = params

Expand Down

0 comments on commit f037d59

Please sign in to comment.