Class: Bugsnag::Railtie
- Inherits:
-
Rails::Railtie
- Object
- Rails::Railtie
- Bugsnag::Railtie
- Defined in:
- lib/bugsnag/integrations/railtie.rb
Constant Summary collapse
- FRAMEWORK_ATTRIBUTES =
{ :framework => "Rails" }
Instance Method Summary collapse
-
#event_subscription(event) ⇒ Object
private
Subscribes to an ActiveSupport event, leaving a breadcrumb when it triggers.
Instance Method Details
#event_subscription(event) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Subscribes to an ActiveSupport event, leaving a breadcrumb when it triggers
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/bugsnag/integrations/railtie.rb', line 77 def event_subscription(event) ActiveSupport::Notifications.subscribe(event[:id]) do |*, event_id, data| filtered_data = data.slice(*event[:allowed_data]) filtered_data[:event_name] = event[:id] filtered_data[:event_id] = event_id if event[:id] == "sql.active_record" && data.key?(:binds) binds = data[:binds].each_with_object({}) { |bind, output| output[bind.name] = '?' if defined?(bind.name) } filtered_data[:binds] = JSON.dump(binds) unless binds.empty? end Bugsnag.( event[:message], filtered_data, event[:type], :auto ) end end |