def parse_uri
      self.uri = URI.parse(raw_url)
      uri.path = "/" if uri.path.empty?
      uri.fragment = nil
      # if this fails, mark the URL as invalid
    rescue
      self.valid = false
    end
def parse_uri
      self.uri = URI.parse(raw_url)
      uri.path = "/" if uri.path.empty?
      uri.fragment = nil
      # if this fails, mark the URL as invalid
    rescue
      self.valid = false
    end
Parse the raw URL as a URI object