Tracking/Logging ActiveRecord Callbacks

前端 未结 4 1872
深忆病人
深忆病人 2020-12-18 00:14

Is there any way to automatically log everytime an ActiveRecord callback happens? It would help to trace through why certain things are happened when a record has several ca

4条回答
  •  被撕碎了的回忆
    2020-12-18 00:20

    I just wrote a gem for this.

    # Gemfile
    gem "rails-callback_log", group: [:development, :test]
    
    • https://github.com/jaredbeck/rails-callback_log
    • https://rubygems.org/gems/rails-callback_log

提交回复
热议问题