AbstractActiveRecord test and improvements