I would add

```ruby
if Apipie.configuration.record
```

here as well, to avoid unnecessary calls when not needed