Skip to content

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

Open
itoldya wants to merge 1 commit intoPaulUithol:masterfrom
itoldya:master
Open

Using related.attributes[ key ] instead of related.get( key ) in toJSON#379
itoldya wants to merge 1 commit intoPaulUithol:masterfrom
itoldya:master

Conversation

@itoldya
Copy link
Copy Markdown

@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
Copy link
Copy Markdown
Owner

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants