proper checking for subclass of activerecord base in activerecord adapter