提交 84d57bc7 编写于 作者: D Douwe Maan

Make code clearer

上级 bed263f0
......@@ -6,18 +6,16 @@ module Gitlab
private
def get_info(key)
raw_key = ldap_config.attributes[key]
return super unless raw_key
attributes = ldap_config.attributes[key]
return super unless attributes
value =
case raw_key
when String
get_raw(raw_key)
when Array
raw_key.inject(nil) { |value, key| value || get_raw(key).presence }
else
nil
end
attributes = Array(attributes)
value = nil
attributes.each do |attribute|
value = get_raw(attribute)
break if value.present?
end
return super unless value
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册