Class: RailsLiveDashboard::Subscribers::ActiveRecordSubscriber
- Inherits:
-
Object
- Object
- RailsLiveDashboard::Subscribers::ActiveRecordSubscriber
- Defined in:
- lib/rails_live_dashboard/subscribers/active_record_subscriber.rb
Instance Method Summary collapse
-
#initialize ⇒ ActiveRecordSubscriber
constructor
A new instance of ActiveRecordSubscriber.
Constructor Details
#initialize ⇒ ActiveRecordSubscriber
Returns a new instance of ActiveRecordSubscriber.
4 5 6 7 8 9 10 11 12 |
# File 'lib/rails_live_dashboard/subscribers/active_record_subscriber.rb', line 4 def initialize ActiveSupport::Notifications.subscribe 'sql.active_record' do |event| next if should_skip(event) Recorders::QueryRecorder.new(event).execute rescue StandardError => e Rails.logger.error "ActionRecordSubscriber - Error on handle active record event: #{e.}" end end |