如何删除供应商代码插入的回调?

Joh*_*hir 3 controller ruby-on-rails callback

我正在使用的gem插入一个我想删除的after_save回调.在我看来,从数组中删除符号比使用monkeypatch修复问题更清晰.如何访问回调数组?

小智 11

class UserSession < Authlogic::Session::Base
  # Don't use cookie AuthLogic behaviour
  skip_callback :persist, :persist_by_cookie
  skip_callback :after_save, :save_cookie
  skip_callback :after_destroy, :destroy_cookie
end
Run Code Online (Sandbox Code Playgroud)

  • 对我来说(rails 3.1)我不得不使用`skip_callback:destroy,:after,:destroy_cookie`(为我自己的用例解释) (3认同)