after certain moments of an object’s life cycle • 6 events : create, save, update, delete, validate, load • Register using a macro-style class method ★ as an ordinary method or ★ supply as a block 13֙ 4ਘ 27ੌ షਃੌ
puts "You have initialized an object!" end after_find do |user| puts "You have found an object!" end end >> User.new You have initialized an object! => #<User id: nil> >> User.first You have found an object! You have initialized an object! => #<User id: 1> 13֙ 4ਘ 27ੌ షਃੌ