noeticpenguin / ngForce

Force.com && Angular.js integration framework.
noeticpenguin.github.io/ngForce
MIT License
142 stars 61 forks source link

strip off 'attribuates' before update/insert/etc #9

Closed mshanemc closed 10 years ago

mshanemc commented 10 years ago

Use case: vfr.query an object, do some manipulation, then you want to put it with vfr.update.

If you put back what you pulled down, it's trying to write the 'attributes' part of the object, which of course doesn't exist in SF.

This removes it. The apex map method 'remove' won't get upset if it doesn't exist, so this is safe.

I had the choice between doing this here in the class, but it could also be done with delete in the js component. The only benefit there is that it would save a little bit of payload.

noeticpenguin commented 10 years ago

@mshanemc I've accepted this PR, though not in a traditional merge situation. Your contribution has been added to the new develop branch that we're working on.