method

with_debug

rails latest stable - Class: ActiveSupport::EventReporter

Method not available on this version

This method is only available on newer versions. The first available version (v8.1.1) is shown here.

with_debug()
public

Temporarily enables debug mode for the duration of the block. Calls to debug will only be reported if debug mode is enabled.

Rails.event.with_debug do
  Rails.event.debug("sql.query", { sql: "SELECT * FROM users" })
end