ActiveRecord 回调
我使用回调 before_create 更新观察者中记录的特定字段。是否更新,同样触发回调after_update。 ?就像我的例子一样。这似乎正在发生。我通过在代码中放置调试器来确认。为什么会出现这种情况?
I update a particular field of a record in my observer with a callback before_create . Does this update, also trigger the callback after_update. ? As in my case. This seems to be happening. I confirmed by placing debuggers in my code. Why does this happen ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Rails ActiveRecord 回调层次结构
Rails ActiveRecord callback hierarchy