Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added model stub EJS template.

  • Loading branch information...
commit 59a6535a274ca373a684c3cc54b0ea2b33dee49c 1 parent ebb710a
@mde mde authored
Showing with 35 additions and 0 deletions.
  1. +35 −0 geddy-core/scripts/gen/resource_model.ejs
View
35 geddy-core/scripts/gen/resource_model.ejs
@@ -0,0 +1,35 @@
+
+var <%= nameSingular %> = function () {
+ /*
+ this.property('login', 'String', {required: true});
+ this.property('password', 'String', {required: true});
+ this.property('lastName', 'String');
+ this.property('firstName', 'String');
+
+ this.validatesPresent('login');
+ this.validatesFormat('login', /[a-z]+/, {message: 'Subdivisions!'});
+ this.validatesLength('login', {min: 3});
+ // Use with the name of the other parameter to compare with
+ this.validatesConfirmed('password', 'confirmPassword');
+ // Use with any function that returns a Boolean
+ this.validatesWithFunction('password', function (s) {
+ return s.length > 0;
+ });
+
+ // Can define methods for instances like this
+ this.someMethod = function () {
+ // Do some stuff
+ };
+ */
+
+};
+
+/*
+// Can also define them on the prototype
+User.prototype.someOtherMethod = function () {
+ // Do some other stuff
+};
+*/
+
+exports.<%= nameSingular %> = <%= nameSingular %>;
+
Please sign in to comment.
Something went wrong with that request. Please try again.