123456789_123456789_123456789_123456789_123456789_

Class: ActiveRecord::ExplainSubscriber

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: activerecord/lib/active_record/explain_subscriber.rb

Constant Summary

Instance Method Summary

Instance Method Details

#finish(name, id, payload)

[ GitHub ]

  
# File 'activerecord/lib/active_record/explain_subscriber.rb', line 12

def finish(name, id, payload)
  if ExplainRegistry.collect? && !ignore_payload?(payload)
    ExplainRegistry.queries << payload.values_at(:sql, :binds)
  end
end

#ignore_payload?(payload) ⇒ Boolean

[ GitHub ]

  
# File 'activerecord/lib/active_record/explain_subscriber.rb', line 25

def ignore_payload?(payload)
  payload[:exception] ||
    payload[:cached] ||
    IGNORED_PAYLOADS.include?(payload[:name]) ||
    !payload[:sql].match?(EXPLAINED_SQLS)
end

#start(name, id, payload)

[ GitHub ]

  
# File 'activerecord/lib/active_record/explain_subscriber.rb', line 8

def start(name, id, payload)
  # unused
end