concept callback in category ruby

This is an excerpt from Manning's book The Well-Grounded Rubyist, Third Edition.
We’ll look again at method_missing in chapter 15, as part of a broader look at Ruby’s runtime hooks and callbacks, of which method_missing is only one. (There’s also one called respond_to_missing?, which as its name implies, is a sort of hybrid.) It’s worth having introduced method_missing here, though, because it’s probably the most commonly used member of the callback family, and one that you’re likely to see and hear discussed sooner rather than later in your Ruby explorations.
The use of callbacks and hooks is a fairly common meta-programming technique. These methods are called when a particular event takes place during the run of a Ruby program. An event is something like
Runtime hooks and callbacks for objects, classes, and modules

This is an excerpt from Manning's book Rails 3 in Action.
This operation is quick and is exceptionally useful if you have a large number of tickets that don’t have callbacks. If you do have callbacks on Ticket for a destroy operation, then you should use the first option, :dependent => :destroy.
To do this you can use a callback to set the ticket’s status when you change it through the comment form. A callback is a method that’s called either before or after a certain event. For models, there are before-and-after callbacks for the following events (where * can be substituted for either before or after):