def default_url_options(*args)
      defaults = {}
      request  = Thread.current["actiondispatch.request"]

      if request
        host     = request.host
        port     = request.port
        protocol = request.protocol
        standard_port = request.standard_port

        defaults[:protocol] = protocol
        defaults[:host]     = host
        defaults[:port]     = port if port != standard_port
      end

      super.merge(defaults)
    end
def default_url_options(*args)
      defaults = {}
      request  = Thread.current["actiondispatch.request"]

      if request
        host     = request.host
        port     = request.port
        protocol = request.protocol
        standard_port = request.standard_port

        defaults[:protocol] = protocol
        defaults[:host]     = host
        defaults[:port]     = port if port != standard_port
      end

      super.merge(defaults)
    end
Extends ActionMailer#default_url_options capabilities
 by merging the latest request context into the default url options.

 Returns the default url options Hash.