lib/relations/has_one.js
function(instance, value) {
    var collection = this._getCollectionCache(instance);
    var current = collection && collection[0];
    if (current) { this.removeObjects(instance, current); }
    if (value) { this.addObjects(instance, value); }
  }
function(instance, value) {
    var collection = this._getCollectionCache(instance);
    var current = collection && collection[0];
    if (current) { this.removeObjects(instance, current); }
    if (value) { this.addObjects(instance, value); }
  }
function ( instance , value ) { var collection = this . _getCollectionCache ( instance ) ; var current = collection && collection [ 0 ] ; if ( current ) { this . removeObjects ( instance , current ) ; } if ( value ) { this . addObjects ( instance , value ) ; } }
The item property setter for this relation.

This property allows altering the associated object of a specific model in
a given relation.

It is accessible on an individual model via assignment with `<singular>`
and via `set<Singular>`. For instance, a user that has one blog would
cause this method to get triggered via
`user.blog = '...'` or `user.setBlog`.

The naming conventions are set forth in {@link HasOne#overrides}.

@method
@protected
@param {Model} instance The model instance on which to operate.
@see {@link BaseRelation#methods}
The item property setter for this relation .