-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
Support clone with relation (fix #381) #382
Support clone with relation (fix #381) #382
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! If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact [email protected] if you have any questions. |
signed. |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
I fixed a bug related to this change. Sorry for confusing. It's mergeable now. |
src/__tests__/ParseObject-test.js
Outdated
@@ -465,15 +456,46 @@ describe('ParseObject', () => { | |||
'Called relation() on non-relation field age' | |||
); | |||
var rel = o.relation('friends'); | |||
expect(rel.parentClass).toBe('Person'); | |||
expect(rel.parentId).toBe('AA'); |
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.
why this change? this seems to be a breaking on.
@yuki-takeichi ping |
Codecov Report
@@ Coverage Diff @@
## master #382 +/- ##
==========================================
+ Coverage 85.75% 85.82% +0.07%
==========================================
Files 48 48
Lines 3909 3915 +6
Branches 890 892 +2
==========================================
+ Hits 3352 3360 +8
+ Misses 557 555 -2
Continue to review full report at Codecov.
|
Needed for parse-community/parse-dashboard#924 @flovilmart I found a simpler solution and added more tests for this |
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.
How do you clone a relation? As it uses the source pointerId, then the cloned object would not reference the related objects, unless you’d resave the whole join table.
Its more of getting and saving relation on a cloned object. I may have found a separate issue while doing this. I'll add a few more tests. |
How does this look? |
Uhm. Ok, reading back the original issue I guess it makes sense. |
Fix #381