activerecord refactor register