Skip to content
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

Merged
merged 8 commits into from
Dec 2, 2018

Conversation

yuki-takeichi
Copy link
Contributor

Fix #381

@facebook-github-bot
Copy link

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.

@yuki-takeichi
Copy link
Contributor Author

signed.

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@yuki-takeichi
Copy link
Contributor Author

I fixed a bug related to this change. Sorry for confusing. It's mergeable now.

@@ -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');
Copy link
Contributor

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.

@flovilmart
Copy link
Contributor

@yuki-takeichi ping

@codecov
Copy link

codecov bot commented Aug 6, 2018

Codecov Report

Merging #382 into master will increase coverage by 0.07%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
src/ParseObject.js 88.73% <100%> (+0.31%) ⬆️
src/ParseOp.js 82.07% <100%> (+0.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cea20a6...d2a9335. Read the comment docs.

@dplewis
Copy link
Member

dplewis commented Dec 1, 2018

Needed for parse-community/parse-dashboard#924

@flovilmart I found a simpler solution and added more tests for this

@dplewis dplewis requested a review from flovilmart December 1, 2018 22:38
Copy link
Contributor

@flovilmart flovilmart left a 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.

@dplewis
Copy link
Member

dplewis commented Dec 1, 2018

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.

@dplewis
Copy link
Member

dplewis commented Dec 2, 2018

How does this look?

@flovilmart
Copy link
Contributor

Uhm. Ok, reading back the original issue I guess it makes sense.

@dplewis dplewis merged commit 2b1fc0a into parse-community:master Dec 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants