Repository navigation
Extend options arg to support custom model definitions - #100
shlomiassaf wants to merge 6 commits into
Conversation
Extend the options argument of boot/compile to allow the developer to supply custom model definitions (to replace the result of findModelDefinitions). Together with the existing options.models, it will allow you to specify all model-related data and still use the benefits which loopback-boot provides (most notably loading models in order defined by inheritance, i.e. base models are loaded before models that are extending them).
|
Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test." |
|
@slnode test please |
There was a problem hiding this comment.
This block should be run only when definition.sourceFile is defined. Please add a unit-test covering this case too.
There was a problem hiding this comment.
@bajtos, added.
unit test is not needed, it is tested in "should not set source file path if no source file supplied.".
Since the block is in try/catch it will not load it anyway, just waste some resources try to get it... This is the implementation in "loadModelDefinition()"
I blocked it with an if statement just in case...
|
@shlomiassaf thank you for the reworked pull request, it looks much better now. Please address my comments above. I also need you to sign our CLA before I can land the patch. See the details of the failed "clahub" check at the bottom. |
|
@bajtos , Addressed your notes. I pushed them before signing the CLA so the link is lost. Thanks. |
|
The link to CLA: https://cla.strongloop.com/agreements/strongloop/loopback-boot |
|
@slnode test please |
|
Can we land this? |
There was a problem hiding this comment.
This does not support the case when the sourceFile value does not have any extension and there are two files matching this value - one is .json and the other .coffee. See #59 for more details.
|
Thank you for the update. AFAICT, you haven't addressed one of my initial comments yet. Plus I found another issue, see the new comment above. |
|
@shlomiassaf ping, what's the status of this patch? Are you still keen to finish it? |
|
@bajtos , sorry for the delay, work pressure. Will do my best to finish this week, thanks for the update. |
Added support for sourceFile handling that has no extension.
|
@bajtos, you can run tests |
|
@slnode ok to test |
|
@shlomiassaf Thank you for the update. I have quite a lot of other work on my plate, so I can't review right now, but I'll try to get back to this as soon as possible. |
|
@shlomiassaf would you mind rebasing your patch on top of the current master branch and fixing the merge conflicts? |
Extend the options argument of boot/compile to allow the developer to supply custom model definitions (to replace the result of findModelDefinitions). Together with the existing options.models, it will allow you to specify all model-related data and still use the benefits which loopback-boot provides (most notably loading models in order defined by inheritance, i.e. base models are loaded before models that are extending them).
See @bajtos issue, #49