Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Makes the model generator behave the same when using resource or scaf…

…fold (it sets autoincrement for int ids)
  • Loading branch information...
commit ce17892de68c1172e89587253b2c5ea94541dc19 1 parent 33d2981
@MiguelMadero authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 templates/resource/model.ejs
View
7 templates/resource/model.ejs
@@ -13,7 +13,12 @@ var <%= names.constructor.singular %> = function () {
<% } -%>
});
- this.adapter = "memory";
+<% for(var i in properties) { -%>
+<% if(properties[i].name === 'id' && properties[i].type === 'int') { -%>
+ this.autoIncrementId = true;
+<% } -%>
+<% } -%>
+ this.adapter = 'memory';
/*
this.property('login', 'string', {required: true});
Please sign in to comment.
Something went wrong with that request. Please try again.