model.js
function(prop, def) {
    def = def ? def : _.result(this, 'definition');

    return _.reduce(def, function(attrs, attr, key) {
      if (attr.type === 'object') {
        var nested = this.findAttributes(prop, attr.fields || {});
        if (!_.isEmpty(nested)) {
          attrs[key] = nested;
        }
      } if (attr[prop]) {
        attrs[key] = true;
      }
      return attrs;
    }.bind(this), {});
  }
function(prop, def) {
    def = def ? def : _.result(this, 'definition');

    return _.reduce(def, function(attrs, attr, key) {
      if (attr.type === 'object') {
        var nested = this.findAttributes(prop, attr.fields || {});
        if (!_.isEmpty(nested)) {
          attrs[key] = nested;
        }
      } if (attr[prop]) {
        attrs[key] = true;
      }
      return attrs;
    }.bind(this), {});
  }
function ( prop , def ) { def = def ? def : _ . result ( this , 'definition' ) ; return _ . reduce ( def , function ( attrs , attr , key ) { if ( attr . type === 'object' ) { var nested = this . findAttributes ( prop , attr . fields || { } ) ; if ( ! _ . isEmpty ( nested ) ) { attrs [ key ] = nested ; } } if ( attr [ prop ] ) { attrs [ key ] = true ; } return attrs ; } . bind ( this ) , { } ) ; }
Define attributes that are not settable from the request

@param  {String} prop
@param  {Object} def
@return {Object}
Define attributes that are not settable from the request