Load activerecord database if not loaded when getting class name