move visit functionality to activerecord model