parse.com - request.object.previous() is not working in beforeSave() -


i'm trying check current , previous value of attribute in beforesave(). tried use request.object.previous("attribute_name") still returning current changed value. although .ditry() returning true means value changed. idea wrong here ? appreciate feedback.

i think .previous() isn't part of parse.com sdk, inherited backbone.

in beforesave handler, have like:

if(object.dirty("attr")) {     console.log("after: " + object.get("attr") + ", before: " + object.previous("attr")); } 

the value returned 'previous' same. functionality implemented? i've seen few threads elsewhere imply it's not - if so, can remove api docs until it's done?

if doesn't work, correct workaround query previous object? or 'changedattributes' work? oh, see 'previous' cruft backbone.

source1

previous method inherited backbone.model. won't return previous value of field in cloud code.

source2

might not answer you're looking for, way workaround lack of .previous implementation this out:

don't know if helpful or if considered costly of workaround, add column object being updated stores previous value of original column. allow access previous value in aftersave function.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -