Rails3 compatibility: replace before_save