detecting when a record is saved

try the after_save callback