code: function(attr) {
          var value = this.get(attr);
          if (value) {
            if (!(value instanceof AV.Relation)) {
              throw new Error('Called relation() on non-relation field ' + attr);
            }
            value._ensureParentAndKey(this, attr);
            return value;
          } else {
            return new AV.Relation(this, attr);
          }
        }
docs: Gets a relation on the given class for the attribute.
  @param {String} attr The attribute to get the relation for.
  @return {AV.Relation}