Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convenience getType functions, bulk load function, addOptions function #49

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
Next Next commit
Add addOptions function for dynamic extension
  • Loading branch information
patakijv committed Sep 22, 2016
commit 81bc09ee07ca883155cab5c1ec43aa9fb30aa9ce
9 changes: 9 additions & 0 deletions joli.js
Expand Up @@ -413,6 +413,15 @@ var joliCreator = function() {
},
truncate: function() {
new joli.query().destroy().from(this.table).execute();
},
// add options to post model construction - for adding methods later
addOptions: function(options) {
if (options.methods) {
joli.each(options.methods, function(method, name) {
this[name] = method;
}, this);
}
joli.setOptions.call(this, options, this.options);
}
};

Expand Down