`Mapping.path_and_query` is equivalent to `URI#request_uri`. You can rewrite this as

```ruby
  self.path = URI.parse(uri).request_uri
```

and lose the extra method

(I had to look it up, as I've written the same myself many times :wink:)