Sha256: efa8037711f7b77e666e516f05ce71161bd1787c6ad3e33aafd6aa609ed4893c
Contents?: true
Size: 939 Bytes
Versions: 28
Compression:
Stored size: 939 Bytes
Contents
require 'active_support/core_ext/module/attr_internal' module Rails module Sequel module Railties module ControllerRuntime extend ActiveSupport::Concern protected attr_internal :db_runtime def cleanup_view_runtime db_rt_before_render = ::Rails::Sequel.reset_runtime runtime = super db_rt_after_render = ::Rails::Sequel.reset_runtime self.db_runtime = db_rt_before_render + db_rt_after_render runtime - db_rt_after_render end def append_info_to_payload(payload) super payload[:db_runtime] = db_runtime end module ClassMethods def log_process_action(payload) messages, db_runtime = super, payload[:db_runtime] messages << ("Models: %.1fms" % db_runtime.to_f) if db_runtime messages end end end end end end
Version data entries
28 entries across 28 versions & 5 rubygems