Explorar el Código

fixed quoteField.

Nicolas Cannasse hace 19 años
padre
commit
a02e93fe73
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. 3 2
      std/neko/db/Manager.hx

+ 3 - 2
std/neko/db/Manager.hx

@@ -46,7 +46,7 @@ class Manager<T : Object> {
 
 	public function new( cl : Dynamic ) {
 		// get basic infos
-		table_name = if( cl.TABLE_NAME != null ) cl.TABLE_NAME else cl.__name__.join("_");
+		table_name = quoteField(if( cl.TABLE_NAME != null ) cl.TABLE_NAME else cl.__name__.join("_"));
 		table_keys = if( cl.TABLE_IDS != null ) cl.TABLE_IDS else ["id"];
 		class_proto = cl;
 
@@ -267,7 +267,8 @@ class Manager<T : Object> {
 	}
 
 	function quoteField(f : String) {
-		if( f == "read" || f == "desc" || f == "out" )
+		var fsmall = f.toLowerCase();
+		if( fsmall == "read" || fsmall == "desc" || fsmall == "out" || fsmall == "group" )
 			return "`"+f+"`";
 		return f;
 	}