Module: Railswatch::Extensions::Db
- Defined in:
- lib/railswatch/extensions/trace_db.rb
Instance Method Summary collapse
-
#sql(event) ⇒ Object
in env this works if config.log_level = :debug.
Instance Method Details
#sql(event) ⇒ Object
in env this works if config.log_level = :debug
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/railswatch/extensions/trace_db.rb', line 8 def sql(event) sql_text = event.payload[:sql].to_s return super if sql_text.match?(/\brailswatch_/i) CurrentRequest.current.trace({ group: :db, duration: event.duration.round(2), sql: sql_text }) super end |