You can change the lines:

```ruby
@query_cache_enabled = old
clear_query_cache if @query_cache_enabled
```