Commits

Harro Verton committed 8912b1f

deal with the 3.0-dev change from CI_DB_active_record to CI_DB_query_builder

Comments (0)

Files changed (1)

application/third_party/datamapper/system/DB.php

 
 	if ( ! isset($active_record) OR $active_record == TRUE)
 	{
-		require_once(BASEPATH.'database/DB_active_rec.php');
+		if (file_exists(BASEPATH.'database/DB_active_rec.php'))
+		{
+			require_once(BASEPATH.'database/DB_active_rec.php');
+			if ( ! class_exists('CI_DB'))
+			{
+				eval('class CI_DB extends CI_DB_active_record { }');
+			}
+		}
+		else
+		{
+			require_once(BASEPATH.'database/DB_query_builder.php');
+			if ( ! class_exists('CI_DB'))
+			{
+				eval('class CI_DB extends CI_DB_query_builder { }');
+			}
+		}
 
-		if ( ! class_exists('CI_DB'))
-		{
-			eval('class CI_DB extends CI_DB_active_record { }');
-		}
 	}
 	else
 	{