Commit 84d57bc7 authored by Douwe Maan's avatar Douwe Maan

Make code clearer

parent bed263f0
...@@ -6,18 +6,16 @@ module Gitlab ...@@ -6,18 +6,16 @@ module Gitlab
private private
def get_info(key) def get_info(key)
raw_key = ldap_config.attributes[key] attributes = ldap_config.attributes[key]
return super unless raw_key return super unless attributes
value = attributes = Array(attributes)
case raw_key
when String value = nil
get_raw(raw_key) attributes.each do |attribute|
when Array value = get_raw(attribute)
raw_key.inject(nil) { |value, key| value || get_raw(key).presence } break if value.present?
else end
nil
end
return super unless value return super unless value
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment