Enhanced support of association loading and added multilevel association
As discussed on this issue (https://github.com/DanielHreben/sequelize-transparent-cache/issues/34) I added a more safe loadAssociations function to the project which should not error if the name is not defined or found.
@ignacioblit seems like the problem is fixed, can you please confirm and close this PR if so?
@DanielHreben https://github.com/DanielHreben/sequelize-transparent-cache/pull/41/ would still throw if the model name is not as expected, just as described on https://github.com/DanielHreben/sequelize-transparent-cache/issues/34 .
It also does not cover the case of loading associations within associations, which I think is a valid important use case.
Both of these use cases are covered in this PR. The _injectScope({}) is optional, if that is what scares you, though I think having the configured scope is also nice to have.
I would really like to see this functionality in the library, if you are willing, please work with me to get this to a state where you are comfortable merging.
@ignacioblit got it. I don't mind to have this code in the library, my main concern is missing tests. So if you can add tests covering all cases this code supposed to fix - we can merge it.