code: function linkModel (controller, args) {
      // get model from controller
      var model = controller.model
      // get record from args
      var record = args[model.name]
      // get relation by name
      var relation = model.relation(args.relation)
      // require relation with via
      if (!relation || !relation.via) {
          httpError(400, 'Invalid Relation')
      }
      // args for create
      var createArgs = {
          session: args.session,
      }
      // set model id
      createArgs[relation.viaModelIdColumn] = record.raw[relation.modelIdColumn]
      createArgs[relation.viaRelationIdColumn] = args.relationId
      // create relation
      return relation.viaModel.createMeta(createArgs)
      // take appropriate action on success
      .then(record => {
          // if json then return raw data
          if (args.json) {
              return record
          }
          // if html then redirect
          else {
              httpRedirect(args.redirect || args.referrer)
          }
      })
  }
docs: @function linkModel
  
  link model to related model
  
  @param {object} controller
  @param {object} args
  
  @returns {Promise}