brikteknologier / seraph-model

thin model layer for seraph/neo4j (node.js)
MIT License
111 stars 28 forks source link

Add direction to Model.compose() #85

Closed highfivedenis closed 8 years ago

highfivedenis commented 9 years ago

https://github.com/brikteknologier/seraph-model/issues/83

jonpacker commented 9 years ago

Hey! Thanks for taking the initiative. I would love it if there some unit tests for this.

highfivedenis commented 9 years ago

i fail to launch test right now, i have to fix that and i will write the test :)

helgeholm commented 9 years ago

Unless I misread the code, I think the new default direction "->" is the opposite of the original direction "<-". It would be less breaking if the new default matched the old.

highfivedenis commented 9 years ago

@deestan : you're right i just change it @jonpacker : I have fix some bugs, add read/write compose compatibility and test.

highfivedenis commented 9 years ago

Ready for review

jonpacker commented 9 years ago

Hi! I see there's no tests for actually reading a composited model with different directions on the relationships. It's pretty important, cause there's some code in there that I don't really understand, and I'm not sure if it's working or not without a test to verify.

highfivedenis commented 9 years ago

I add a bidirectionnal composition in the test

jonpacker commented 9 years ago

Ok, I'm looking for some tests that test a model with both an out composition and an in composition. There should be one that saves a model with such data, and verifies the integrity of it in the database (as far as I can tell this is all working already); and another one which reads the model back out of the database successfully. It's the reading part which I'm concentrating on here.

highfivedenis commented 9 years ago

ready for review

highfivedenis commented 9 years ago

up