lib/sequel_rails/railties/controller_runtime.rb in sequel-rails-0.9.10 vs lib/sequel_rails/railties/controller_runtime.rb in sequel-rails-0.9.11
- old
+ new
@@ -12,10 +12,11 @@
def process_action(action, *)
# We also need to reset the runtime before each action
# because of queries in middleware or in cases we are streaming
# and it won't be cleaned up by the method below.
::SequelRails::Railties::LogSubscriber.reset_runtime
+ ::SequelRails::Railties::LogSubscriber.reset_count
super
end
def cleanup_view_runtime
db_rt_before_render = ::SequelRails::Railties::LogSubscriber.reset_runtime
@@ -27,9 +28,10 @@
end
def append_info_to_payload(payload)
super
payload[:db_runtime] = (db_runtime || 0) + ::SequelRails::Railties::LogSubscriber.reset_runtime
+ payload[:db_query_count] = ::SequelRails::Railties::LogSubscriber.count
end
module ClassMethods
def log_process_action(payload)
messages, db_runtime = super, payload[:db_runtime]