I find `tap` can make these kinds of things easier to read as everything looks logically subordinate (also, I'd not use "query" - we're always talking about a set of mappings):

```ruby
    @mappings = @site.mappings.order(:path).page(params[:page]).tap do |mappings|
      params[:filter_field] == 'new_url' ?
        mappings.redirects.filtered_by_new_url(params[:contains]) :
        mappings.filtered_by_path(params[:contains])
    end
```

Also, I suppose I'd be in violation of the styleguide for using a ternary, but I just find 3 lines easier to parse quickly than 5. Told you I was OCD about `else` :persevere: