code: function buildWhereRelation (name, value) {
      // require valid relation
      assert.ok(typeof value === 'object', 'invalid relation '+typeof value)
      // get relation
      var relation = this.model.relation(value.name)
      // build relation query
      return defined(relation.via)
          ? this.buildWhereRelationVia(name, value, relation)
          : this.buildWhereRelationDirect(name, value, relation)
  }
docs: @function buildWhereRelation
  
  build where clause for related model
  
  @param {string} name
  @param {array|boolean|object|string} value
  
  @throws {Error}