1602 / jugglingdb

Multi-database ORM for nodejs: redis, mongodb, mysql, sqlite3, postgresql, arango, in-memory...
http://1602.github.io/jugglingdb/
2.05k stars 241 forks source link

Updating include syntax to support hasAndBelongsToMany relationships #368

Closed mshick closed 10 years ago

mshick commented 10 years ago

I hope this is a minimally invasive change to support hasAndBelongsToMany relationships when using the include style syntax. I dangle an additional reference on the relation model, modelThrough and use that in the include logic; branching to a second include call or to returning a normal modelTo.all callback.

I also handled all the jshint errors I was getting in lib/include.js.

1602 commented 10 years ago

Wow. You did a good job on rewriting this code. I see no problems after brief look. As for tests, I agree with you, test/include.js is proper place for checking this logic. Thanks!

mshick commented 10 years ago

Okay, I got a simple test in there. Thanks for checking it out!

Anachron commented 10 years ago

Ping @1602

faceleg commented 10 years ago

@1602 please review?

faceleg commented 10 years ago

THANKS! :dancer: