Module: Datapathy::Railties::ControllerRuntime

Extended by:
ActiveSupport::Concern
Defined in:
lib/datapathy/railtie.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#append_info_to_payload(payload) ⇒ Object



31
32
33
34
# File 'lib/datapathy/railtie.rb', line 31

def append_info_to_payload(payload)
  super
  payload[:query_runtime] = self.query_runtime
end

#cleanup_view_runtimeObject



23
24
25
26
27
28
29
# File 'lib/datapathy/railtie.rb', line 23

def cleanup_view_runtime
  runtime_before_render = Datapathy::LogSubscriber.reset_runtime
  runtime = super
  runtime_after_render = Datapathy::LogSubscriber.reset_runtime
  self.query_runtime = runtime_before_render + runtime_after_render
  runtime - runtime_after_render
end