From 654cbb1d043a97ae9b32672e1333d5e1dd5e59fb Mon Sep 17 00:00:00 2001 From: Harminder Virk Date: Sat, 27 Feb 2016 10:56:08 +0530 Subject: [PATCH] feat(util): add method to make dynamic scopes name dynamic scopes are like macros to query builder --- lib/util.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/util.js b/lib/util.js index b3b05e86..2f8684fd 100644 --- a/lib/util.js +++ b/lib/util.js @@ -114,6 +114,20 @@ util.makeSetterName = function (name) { return `set${i.camelize(i.underscore(name))}` } +/** + * makes a dynamic scope method for a given name + * + * @method makeScopeMethodName + * + * @param {String} name + * @return {String} + * + * @public + */ +util.makeScopeMethodName = function (name) { + return `scope${i.camelize(name)}` +} + /** * map values for a given key and returns * the transformed array with that key only