def alias_setting(*keys, to: nil)
      flat_setting = flatten_keys(keys)
      alias_keys = Array(to)
      alias_key = flatten_keys(alias_keys)

      if alias_key == flat_setting
        raise ArgumentError, 'Alias matches setting key'
      end

      if fetch(alias_key)
        raise ArgumentError, 'Setting already exists with an alias ' \
                             "'#{alias_keys.map(&:inspect).join(', ')}'"
      end

      @aliases[alias_key] = flat_setting
    end
def alias_setting(*keys, to: nil)
      flat_setting = flatten_keys(keys)
      alias_keys = Array(to)
      alias_key = flatten_keys(alias_keys)

      if alias_key == flat_setting
        raise ArgumentError, 'Alias matches setting key'
      end

      if fetch(alias_key)
        raise ArgumentError, 'Setting already exists with an alias ' \
                             "'#{alias_keys.map(&:inspect).join(', ')}'"
      end

      @aliases[alias_key] = flat_setting
    end
Define an alias to a nested key

 @example
   alias_setting(:foo, to: :bar)

 @param [Array[String]] keys
   the alias key

 @api public