Backbone-relational icon indicating copy to clipboard operation
Backbone-relational copied to clipboard

findOrCreate not passing options to the parse method.

Open CubedEye opened this issue 12 years ago • 2 comments

The Backbone docs suggest that the parse method takes a second optional argurment for options. The findOrCreate method [line 1641] is not passing the options on to the parse method.

    var parsedAttributes = ( _.isObject( attributes ) && options.parse && this.prototype.parse ) ?
this.prototype.parse( attributes ) : attributes;

Should be:

    var parsedAttributes = ( _.isObject( attributes ) && options.parse && this.prototype.parse ) ?
this.prototype.parse( attributes, options ) : attributes;

CubedEye avatar Mar 31 '13 00:03 CubedEye

Hi Steven. Can you submit a test case that fails without a patch, showing your desired behavior?

philfreo avatar Mar 31 '13 00:03 philfreo

have to keep fixing this myself, currently its line 1797. I dont think there is any extra 'desired behaviour' here other than the parse function should be sent the options in order not to break the backbone interface (its passed in every other case in this project so why not here?).

jeacott avatar Mar 01 '14 10:03 jeacott