Class: RequestTrail::Subscriber
- Inherits:
-
Object
- Object
- RequestTrail::Subscriber
- Defined in:
- lib/request_trail/subscriber.rb
Constant Summary collapse
- SQL_EVENT =
"sql.active_record"- CACHE_READ_EVENT =
"cache_read.active_support"- CACHE_WRITE_EVENT =
"cache_write.active_support"
Class Method Summary collapse
Class Method Details
.attach ⇒ Object
9 10 11 |
# File 'lib/request_trail/subscriber.rb', line 9 def self.attach @attach ||= [sql_subscription, cache_read_subscription, cache_write_subscription] end |
.detach ⇒ Object
13 14 15 16 17 18 |
# File 'lib/request_trail/subscriber.rb', line 13 def self.detach return unless @attach @attach&.each { |sub| ActiveSupport::Notifications.unsubscribe(sub) } @attach = nil end |