Introduction to Callbacks A callback is a method called at specific moments of an object’s lifecycle (right before or after creation, deletion, update, validation, saving, or loading from the database). example: class Listing < ApplicationRecord
after_create :set_expiry_date
private
def set_expiry_date
expiry_date = Date.today + 30.days
self.update_column(:expires_on, expiry_date)
end
end Here…