before_* callbacks can halt execution by returning false.
I have 3 before_destroy callbacks on a model to halt destruction for several possible reasons. I’d like to tell the user which reason it is, but I’ll I get back from the model.destroy is false. How can I send a message out of the model, or determine from the controller which before_destroy callback halted execution?
This is a nice question. I don’t know if there is a good way to do it. The only thing that comes to my mind is using errors[:base] but it sounds a bit of a hack.