[V2] Rails3 compatibility: replace before_save

rebased #327.