Module: Marginalia::ActionControllerInstrumentation
- Defined in:
- lib/marginalia.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(instrumented_class) ⇒ Object
99 100 101 102 103 104 105 106 107 |
# File 'lib/marginalia.rb', line 99 def self.included(instrumented_class) instrumented_class.class_eval do if respond_to?(:around_action) around_action :record_query_comment else around_filter :record_query_comment end end end |
Instance Method Details
#record_query_comment ⇒ Object
109 110 111 112 113 114 |
# File 'lib/marginalia.rb', line 109 def record_query_comment Marginalia::Comment.update!(self) yield ensure Marginalia::Comment.clear! end |