build/rekord.js
function(input)
    {
      if ( isObject( input ) )
      {
        var discriminatedValue = input[ this.discriminator ];
        var model = this.discriminatorsToModel[ discriminatedValue ];

        if ( model )
        {
          return model.Database.keyHandler.buildKeyFromInput( input );
        }
      }

      return input;
    }
function(input)
    {
      if ( isObject( input ) )
      {
        var discriminatedValue = input[ this.discriminator ];
        var model = this.discriminatorsToModel[ discriminatedValue ];

        if ( model )
        {
          return model.Database.keyHandler.buildKeyFromInput( input );
        }
      }

      return input;
    }
function ( input ) { if ( isObject ( input ) ) { var discriminatedValue = input [ this . discriminator ] ; var model = this . discriminatorsToModel [ discriminatedValue ] ; if ( model ) { return model . Database . keyHandler . buildKeyFromInput ( input ) ; } } return input ; }
Builds a key from input. Discriminated collections only accept objects as
input - otherwise there's no way to determine the discriminator. If the
discriminator on the input doesn't map to a Rekord instance OR the input
is not an object the input will be returned instead of a model instance.

@param {modelInput} input -
The input to create a key for.
@return {Any} -
The built key or the given input if a key could not be built.
Builds a key from input . Discriminated collections only accept objects as input - otherwise there s no way to determine the discriminator . If the discriminator on the input doesn t map to a Rekord instance OR the input is not an object the input will be returned instead of a model instance .