Class: RailsLiveDashboard::Subscribers::ActionControllerSubscriber
- Inherits:
-
Object
- Object
- RailsLiveDashboard::Subscribers::ActionControllerSubscriber
- Defined in:
- lib/rails_live_dashboard/subscribers/action_controller_subscriber.rb
Instance Method Summary collapse
-
#initialize ⇒ ActionControllerSubscriber
constructor
A new instance of ActionControllerSubscriber.
Constructor Details
#initialize ⇒ ActionControllerSubscriber
Returns a new instance of ActionControllerSubscriber.
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/rails_live_dashboard/subscribers/action_controller_subscriber.rb', line 4 def initialize ActiveSupport::Notifications.subscribe 'start_processing.action_controller' do |_event| RailsLiveDashboard::Context.instance.start end ActiveSupport::Notifications.subscribe 'process_action.action_controller' do |event| next if event.payload[:controller].include?('RailsLiveDashboard') handle_event(event) rescue StandardError => e Rails.logger.error "Error on handle action controller event: #{e.}" end end |