Module: Stratagem::Crawler::TraceUtils

Included in:
Authentication, Authentication::Base, Session
Defined in:
lib/stratagem/crawler/trace_utils.rb

Instance Method Summary collapse

Instance Method Details

#model_invocations_for_request(type = nil) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/stratagem/crawler/trace_utils.rb', line 3

def model_invocations_for_request(type=nil)
  prior_invocations = ActiveRecord::Base.stratagem.invocations_audit.clone
  yield
  post_invocations = ActiveRecord::Base.stratagem.invocations_audit.clone
  delta = post_invocations - prior_invocations
  delta = delta.select {|i| i.type == type } if (type)
  delta
end