我有一些型号有after_save回调.通常这很好,但在某些情况下,比如在创建开发数据时,我希望在不运行回调的情况下保存模型.有没有简单的方法?类似于...
Person#save( :run_callbacks => false )
或
Person#save_without_callbacks
I looked in the Rails docs and didn't find anything. However in my experience the Rails docs don't always tell the whole st或y.
使现代化
I found a blog post that explains how you can remove callbacks from a model like this:
Foo.after_save.clear
I couldn't find where that method is documented but it seems to w或k.