function(attribute, messages) {
    var wasEmpty = get(this, 'isEmpty');

    messages = this._findOrCreateMessages(attribute, messages);
    get(this, 'content').addObjects(messages);

    this.notifyPropertyChange(attribute);
    this.enumerableContentDidChange();

    if (wasEmpty && !get(this, 'isEmpty')) {
      this.trigger('becameInvalid');
    }
  }
function(attribute, messages) {
    var wasEmpty = get(this, 'isEmpty');

    messages = this._findOrCreateMessages(attribute, messages);
    get(this, 'content').addObjects(messages);

    this.notifyPropertyChange(attribute);
    this.enumerableContentDidChange();

    if (wasEmpty && !get(this, 'isEmpty')) {
      this.trigger('becameInvalid');
    }
  }
function ( attribute , messages ) { var wasEmpty = get ( this , 'isEmpty' ) ; messages = this . _findOrCreateMessages ( attribute , messages ) ; get ( this , 'content' ) . addObjects ( messages ) ; this . notifyPropertyChange ( attribute ) ; this . enumerableContentDidChange ( ) ; if ( wasEmpty && ! get ( this , 'isEmpty' ) ) { this . trigger ( 'becameInvalid' ) ; } }
Adds error messages to a given attribute and sends
`becameInvalid` event to the record.

@method add
@param {String} attribute
@param {Array|String} messages
Adds error messages to a given attribute and sends becameInvalid event to the record .