Merge pull request #1134 from bendiy/no-rest-for-you
authorTravis Webb <travis@traviswebb.com>
Mon, 9 Dec 2013 19:09:36 +0000 (11:09 -0800)
committerTravis Webb <travis@traviswebb.com>
Mon, 9 Dec 2013 19:09:36 +0000 (11:09 -0800)
SYS ORMs cannot be set to isRest: true.

enyo-client/database/orm/models/customer.json
enyo-client/database/orm/models/sales_order.json
lib/orm/source/xt/javascript/orm.sql

index dafa899..2c5bef8 100644 (file)
     "nameSpace": "SYS",
     "type": "CustomerRelation",
     "table": "custinfo",
-    "isRest": true,
     "comment": "Customer Relation Map",
     "privileges": {
       "all": {
index b5ed735..3efa3b6 100644 (file)
     "nameSpace": "SYS",
     "type": "SalesOrderRelation",
     "table": "xt.coheadinfo",
-    "isRest": true,
     "comment": "Sales Order Relation Map",
     "privileges": {
       "all": {
index f422a85..93cf072 100644 (file)
@@ -69,6 +69,7 @@ select xt.install_js('XT','Orm','xtuple', $$
     if(!nameSpace) throw new Error("A name space is required");
     if(!type) throw new Error("A type is required");
     if(!context) throw new Error("A context is required");
+    if(isRest && nameSpace === 'SYS') throw new Error("SYS ORMs cannot be isRest: true.");
 
     sql = 'select orm_id as "id", ' +
           '  orm_json as "json", ' +