Make code clearer
This commit is contained in:
		
							parent
							
								
									bed263f0fe
								
							
						
					
					
						commit
						84d57bc703
					
				| 
						 | 
				
			
			@ -6,17 +6,15 @@ 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
 | 
			
		||||
        attributes = Array(attributes)
 | 
			
		||||
 | 
			
		||||
        value = nil
 | 
			
		||||
        attributes.each do |attribute|
 | 
			
		||||
          value = get_raw(attribute)
 | 
			
		||||
          break if value.present?
 | 
			
		||||
        end
 | 
			
		||||
        
 | 
			
		||||
        return super unless value
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue