Fix have_primary_database? should in app