Fix exception for activerecord adapter