lib/impl/updateRules.js
function createRules(rulesToCreate, cb) {

    function addRule(ruleToCreate, addRuleCallback) {
      var fr = new rulesModel(ruleToCreate);

      fr.save(function(err, frdoc) {
        if (err) {
          return addRuleCallback(err);
        }
        return addRuleCallback(null, frdoc);
      });
    }

    async.map(rulesToCreate, addRule, cb);
  }
function createRules(rulesToCreate, cb) {

    function addRule(ruleToCreate, addRuleCallback) {
      var fr = new rulesModel(ruleToCreate);

      fr.save(function(err, frdoc) {
        if (err) {
          return addRuleCallback(err);
        }
        return addRuleCallback(null, frdoc);
      });
    }

    async.map(rulesToCreate, addRule, cb);
  }
function createRules ( rulesToCreate , cb ) { function addRule ( ruleToCreate , addRuleCallback ) { var fr = new rulesModel ( ruleToCreate ) ; fr . save ( function ( err , frdoc ) { if ( err ) { return addRuleCallback ( err ) ; } return addRuleCallback ( null , frdoc ) ; } ) ; } async . map ( rulesToCreate , addRule , cb ) ; }
iterate through the form field rules vs the new rules
iterate through the form field rules vs the new rules