[V2] Rails3 compatibility: replace before_validation

rebased #320.