Rails 4: Skip callback

前端 未结 4 1540
清酒与你
清酒与你 2021-01-17 21:16

I have an auction and a bid object in my application, when someone presses the BID BUTTON it then calls the BID CREATE controller which cre

4条回答
  •  天涯浪人
    2021-01-17 21:34

    ActiveSupport::Callbacks::ClassMethods#skip_callback is not threadsafe, it will remove callback-methods for time till it is being executed and hence and another thread at same time cannot get the callback-methods for execution.

    Look at the informative post by Allerin - SAVE AN OBJECT SKIPPING CALLBACKS IN RAILS APPLICATION

提交回复
热议问题