How to “update_attributes” without executing “before_save”?

前端 未结 5 769
小蘑菇
小蘑菇 2020-12-15 04:58

I have a before_save in my Message model defined like this:

   class Message < ActiveRecord::Base
     before_save lambda { foo(         


        
5条回答
  •  北海茫月
    2020-12-15 05:23

    update_column or update_columns is the closest method to update_attributes and it avoids callbacks without having to manually circumvent anything.

提交回复
热议问题