Last active
February 14, 2017 03:29
-
-
Save keithpitt/b4be9809e967f328655b95c3c4196254 to your computer and use it in GitHub Desktop.
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 characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment