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

Persisted grandchildren not loaded through child #272

Open
rwd opened this issue Jan 9, 2018 · 1 comment
Open

Persisted grandchildren not loaded through child #272

rwd opened this issue Jan 9, 2018 · 1 comment

Comments

@rwd
Copy link

rwd commented Jan 9, 2018

Scenario:

  • three RDFSource models A, B and C
  • A has children of class B
  • B has children of class C
  • create an A with a child B having a child C
  • persist the instance of A

Expectations:

  1. all of A, B and C should be persisted
  2. after reloading A, its child B should be accessible through it, as should B's child C

Problem:
Expectation 1 is met, but 2 is not. The grandchild C accessed through the properties on A and B is not loaded despite being present in the repository.

The failures in this spec illustrate the problem: https://github.com/rwd/ActiveTriples/blob/spec-grandchild-persistence/spec/integration/grandchild_persistence_spec.rb

Is expectation 2 valid? If so, is this a bug?

@rwd
Copy link
Author

rwd commented Jan 9, 2018

Changing in ActiveTriples::Relation#make_node:

node = klass.from_uri(value, parent)

to:

node = klass.from_uri(value, final_parent)

makes the above spec pass, and does not cause failure of any others.

Is this a valid solution?

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

No branches or pull requests

1 participant