如何删除由供应商代码插入的回调? [英] How can I remove callbacks inserted by vendor code?

查看:120
本文介绍了如何删除由供应商代码插入的回调?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的gem插入我想要移除的after_save回调。对我来说,从数组中删除符号比使用monkeypatch修复问题更清晰。如何访问回调数组?

A gem I am using inserts an after_save callback that I would like to remove. It seems to me it would be cleaner to delete a symbol from an array than to fix the problem with a monkeypatch. How can I access the array of callbacks?

推荐答案

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

这篇关于如何删除由供应商代码插入的回调?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆