code: function setupHooks (InstanceModel, config) {
    const ourHookedFnNames = ['save', 'remove', 'index']
    const schema = InstanceModel.schema
    const hooks = _.values(schema.hooks)
  
    _.forEach(hooks, ho => {
      let addHookFn = 'addDynamicHooks'
      if (!config.promisify) {
        addHookFn = 'addFlexibleHooks'
      }
      InstanceModel.prototype[addHookFn](ho.name)
      const mwopts = { passParams: true }
      _.forEach(ho.fns, (fn, index) => {
        if (ourHookedFnNames.indexOf(ho.name) >= 0) {
          const mwFn = fn
          if (ho.hook === 'post') {
            ho.fns[index] = function (next) {
              mwFn.apply(this)
              next()
            }
          }
  
          mwopts.passParams = false
        }
      })
      InstanceModel.prototype[ho.hook](ho.name, ho.fns, mwopts)
    })
  }
docs: /*!
  Sets up hooks for the new Model
  @param InstanceModel