Rails pass params/arguments to ActiveRecord callback function

前端 未结 4 1367
庸人自扰
庸人自扰 2021-02-05 06:17

I have the snippet below in one of my AR models:

after_update :cache_bust

The cache_bust method in the model accepts a parameter (

4条回答
  •  遥遥无期
    2021-02-05 06:26

    Short answer is No.You cannot pass any arguments. You could use attr_accessor to create a virtual attribute and set that attribute.

提交回复
热议问题