Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
saschagehlich committed Nov 6, 2013
0 parents commit 0a80ab8
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
Nothing to see here, yet.

`sequenice` will be a wrapper for `sequelize` which will result in a nicer
code structure for models. I'm aiming for something like this:

```js
// user.js
function User(s) {
/**
* Field definitions
*/
this.field("name", s.STRING);
this.field("password", s.STRING);
this.field("isAdmin", s.BOOLEAN, { defaultValue: false });

/**
* Associations
*/
this.hasMany("Project", { joinTableModel: "UserProjects" });

/**
* Hooks
*/
this.beforeCreate("myBeforeCreateMethod");

/**
* Getters
*/
this.get("myVariableName");

/**
* Setters
*/
this.set("myVariableName");
}

User.prototype.getMyVariableName = function () {
return this._myVariableName;
}

User.prototype.setMyVariableName = function (value) {
this._myVariableName = value;
}

User.prototype.someInstanceMethod = function () {

}

User.someClassMethod = function () {

}
```

0 comments on commit 0a80ab8

Please sign in to comment.