Last active
February 14, 2017 03:29
Revisions
-
keithpitt revised this gist
Feb 14, 2017 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ # Add this file to `spec/support/active_record_id_tracer.rb` module ActiveRecordIDTracer def insert(*args) super(*args).tap do |returned_id| -
keithpitt revised this gist
Feb 14, 2017 . No changes.There are no files selected for viewing
-
keithpitt revised this gist
Feb 14, 2017 . No changes.There are no files selected for viewing
-
keithpitt created this gist
Feb 14, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ module ActiveRecordIDTracer def insert(*args) super(*args).tap do |returned_id| Rails.logger.debug("\033[1m\033[33mActiveRecordIDTracer\033[0m #{klass.name} insert returned ID #{returned_id}") end end end ActiveRecord::Relation.prepend ActiveRecordIDTracer