-
-
Notifications
You must be signed in to change notification settings - Fork 878
Ability to revert all changes or changes for key #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
- (void)revert; | ||
|
||
/*! | ||
@abstract Reverts any changes to an object's key that were done after last sucessful save/fetch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should actually be
Clears any changes to this object made since the last call to save.
Since it won't revert anything prior to the current operation set in the queue.
@kashif Few nits and important parts, but overall looks amazing. The important part here: |
thanks @nlutsenko gonna fix it up now |
@abstract Clears any changes to this object's key that were done after last successful save and sets it back to the | ||
server state. | ||
|
||
@param key The key to check for. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: The key to revert changes for.
One more set of changes, almost there... Looks almost perfect. @kashif |
Thanks @nlutsenko I will now try to add some unit tests |
@synchronized (lock) { | ||
if ([self isDirty]) { | ||
PFOperationSet *changes = [self unsavedChanges]; | ||
for (NSString* key in changes.keyEnumerator) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Supernit: Use for (NSString *key in...
to be closer to overall coding style.
@kashif Restarted tests, and I think they are going to pass this time. Please let me know if you have any questions around code or having trouble finding anything. |
@kashif, sorry it takes a while to get to every single one of these, since there are literally 0 notifications on when the diff is pushed. |
ok @nlutsenko i think it should pass the tests hopefully thanks again for your helpful suggestions! |
Hey @kashif, so sorry, it looks like there is a merge conflict somewhere in code on this branch. |
ok @nlutsenko rebased and squashed 👍 |
@kashif Thank you so much for all the help, I am merging this one in and it's going to be released as part of 1.8.2 |
Ability to revert all changes or changes for key
For issue #52