Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #217 from MiguelMadero/unifyCodeGeneration

The model generated by resource and scaffold was different
  • Loading branch information...
commit e6a0e671242e4b0e0a063c36fa64221cf3b4b8a8 2 parents ea57fef + 5c0cdea
@larzconwell larzconwell authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 templates/resource/model.ejs
View
6 templates/resource/model.ejs
@@ -12,6 +12,12 @@ var <%= names.constructor.singular %> = function () {
<% } -%>
});
+<% for(var i in properties) { -%>
+<% if(properties[i].name === 'id' && properties[i].type === 'int') { -%>
+ this.autoIncrementId = true;
+<% } -%>
+<% } -%>
+
/*
this.property('login', 'string', {required: true});
this.property('password', 'string', {required: true});
Please sign in to comment.
Something went wrong with that request. Please try again.