class RailsBand::ActiveRecord::LogSubscriber
The custom LogSubscriber
for ActiveRecord
.
Public Instance Methods
instantiation(event)
click to toggle source
# File lib/rails_band/active_record/log_subscriber.rb, line 21 def instantiation(event) consumer_of(__method__)&.call(Event::Instantiation.new(event)) end
sql(event)
click to toggle source
# File lib/rails_band/active_record/log_subscriber.rb, line 17 def sql(event) consumer_of(__method__)&.call(Event::Sql.new(event)) end
strict_loading_violation(event)
click to toggle source
# File lib/rails_band/active_record/log_subscriber.rb, line 13 def strict_loading_violation(event) consumer_of(__method__)&.call(Event::StrictLoadingViolation.new(event)) end
Private Instance Methods
consumer_of(sub_event)
click to toggle source
# File lib/rails_band/active_record/log_subscriber.rb, line 27 def consumer_of(sub_event) consumers[:"#{sub_event}.active_record"] || consumers[:active_record] || consumers[:default] end