Class: Epilog::Rails::ActiveRecordSubscriber
- Inherits:
-
LogSubscriber
- Object
- ActiveSupport::LogSubscriber
- LogSubscriber
- Epilog::Rails::ActiveRecordSubscriber
- Defined in:
- lib/epilog/rails/active_record_subscriber.rb
Constant Summary collapse
- IGNORE_PAYLOAD_NAMES =
%w[SCHEMA EXPLAIN].freeze
Instance Attribute Summary
Attributes inherited from LogSubscriber
Instance Method Summary collapse
Methods inherited from LogSubscriber
#config, #initialize, #pop_context, #push_context
Constructor Details
This class inherits a constructor from Epilog::Rails::LogSubscriber
Instance Method Details
#sql(event) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/epilog/rails/active_record_subscriber.rb', line 8 def sql(event) ActiveRecord::LogSubscriber.runtime += event.duration return unless logger.debug? payload = event.payload return if IGNORE_PAYLOAD_NAMES.include?(payload[:name]) debug( message: payload[:name], sql: payload[:sql], binds: binds_info(payload[:binds] || []), metrics: metrics(event) ) end |