Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

The model generated by resource and scaffold was different #217

Merged
merged 1 commit into from

3 participants

@MiguelMadero

No description provided.

@larzconwell

I'll take a look at this in the morning, what's different? I think I noticed the resource model didn't generate the autoIncrementId if the ID is an int but I can't remember for sure.

@MiguelMadero
@larzconwell larzconwell merged commit e6a0e67 into geddy:master
@larzconwell

Oh awesome, thanks for the pull request man!

@mde
Owner
mde commented

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
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});
Something went wrong with that request. Please try again.