openrecord
Version:
Active record like ORM for nodejs
17 lines (15 loc) • 381 B
JavaScript
/*
* DEFINITION
*/
exports.definition = {
mixinCallback: function() {
this.onRawCondition(function(chain, condition) {
var attrsRegExp = new RegExp(
'(' + Object.keys(chain.definition.attributes).join('|') + ')',
'g'
)
// add quotes to attribute names
condition.query = condition.query.replace(attrsRegExp, '"$1"')
}, 10)
}
}