Sha256: 478a6ac0caf133c8d0066019f2450992b61e4b0a71880936b2cd9b0ac96eab70
Contents?: true
Size: 894 Bytes
Versions: 7
Compression:
Stored size: 894 Bytes
Contents
ActiveRecord::LogSubscriber module ActiveRecord class LogSubscriber def sql(event) self.class.runtime += event.duration return unless logger.debug? payload = event.payload name = payload[:name] return if IGNORE_PAYLOAD_NAMES.include?(name) log = { message: name, sql: payload[:sql], duration: event.duration } unless (payload[:binds] || []).empty? log[:binds] = binds = {} # Changed with Rails 5 if Rails.version.to_i >= 5 payload[:binds].each do |attr| attr_name, value = render_bind(attr) binds[attr_name] = value end else payload[:binds].each do |col, v| attr_name, value = render_bind(col, v) binds[attr_name] = value end end end debug(log) end end end
Version data entries
7 entries across 7 versions & 1 rubygems