Using related.attributes[ key ] instead of related.get( key ) in toJSON #379

Open
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
@itoldya

itoldya commented Jul 14, 2013

Hi!
Standard behavior of Backbone.Model.toJSON method is just clone values from attributes dict. In my case i using some conversion in get and set methods, for example:

model.attributes.position
[51.344338660599234, 22.3681640625]

model.get('position') // return google.maps.LatLng object
P {jb: 51.344338660599234, kb: 22.3681640625, toString: function, b: function, equals: function…}

@PaulUithol

This comment has been minimized.

Show comment Hide comment
@PaulUithol

PaulUithol Jan 16, 2014

Owner

Is anybody else in favor (or opposing to) of making this change? The call to pluck would also have to be changed btw.

Owner

PaulUithol commented Jan 16, 2014

Is anybody else in favor (or opposing to) of making this change? The call to pluck would also have to be changed btw.

@bpatram bpatram added this to the v0.11.0 milestone Mar 28, 2016

@bpatram bpatram added the enhancement label Mar 28, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment