Sha256: b8e3eeb1906591a1144beb1ef76af30ef074721a9575625a6505baf4bdfdf189
Contents?: true
Size: 799 Bytes
Versions: 13
Compression:
Stored size: 799 Bytes
Contents
module EitilSupport::Stack::Audit extend ActiveSupport::Concern included do private after_update :add_stacktrace_to_audit def add_stacktrace_to_audit audited_columns = self.class.audited_columns changed_columns = previous_changes.keys return unless (audited_columns & changed_columns).any? # .report_app_calls filters the stack on calls whose path include "/app/", since # audits otherwise tend to grow very big, which might endanger the database. stacktrace = EitilSupport::Stack.new.report_app_calls return if stacktrace.blank? # Safe operator in order to avoid raising a NoMetodError when the record # has no audits yet. self.audits.last&.update(stacktrace: stacktrace) end end end
Version data entries
13 entries across 13 versions & 1 rubygems