Handle rails databse configuration properly