Sha256: 6f9818d0d490c05f540b11044b43bc804c1b12fcf516cf4ea5090eeca168b1a8
Contents?: true
Size: 996 Bytes
Versions: 6
Compression:
Stored size: 996 Bytes
Contents
require "okuribito" module OkuribitoRails class ObserveMethod def patch_okuribito Okuribito::OkuribitoPatch.new( once_detect: config_once_detect ) do |method_name, _obj_name, caller_info, class_name, method_symbol| ActiveRecord::Base.transaction do situation = MethodCallSituation.find_by(class_name: class_name, method_symbol: method_symbol, method_name: method_name) if situation.present? MethodCallLog.create(method_call_situation: situation, class_name: class_name, method_symbol: method_symbol, method_name: method_name, back_trace: caller_info[0]) end end end end private def config_once_detect OkuribitoRails.config.once_detect end end end
Version data entries
6 entries across 6 versions & 1 rubygems