I want to log the user who destroyed a record using before_destroy callback. But, I dont know how to pass arguments to before_destroy(and I am not sure if it is possible). Maybe I am dealing this in the wrong way. Any other perspective to do this will also do.
I want to log the user who destroyed a record using before_destroy callback. But,
Share
Create a virtual attribute on the
Recordmodel calleddestroyeror something.Then you can do whatever you want with that attribute in your
before_destroycallback.