Skip to content

Extend options arg to support custom model definitions - #100

Closed
shlomiassaf wants to merge 6 commits into
strongloop:masterfrom
shlomiassaf:simpleModelDef
Closed

shlomiassaf wants to merge 6 commits into
strongloop:masterfrom
shlomiassaf:simpleModelDef

Conversation

@shlomiassaf

Copy link
Copy Markdown
Contributor

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

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).
@slnode

slnode commented Feb 24, 2015

Copy link
Copy Markdown

Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test."

@bajtos

bajtos commented Feb 25, 2015

Copy link
Copy Markdown
Member

@slnode test please

Comment thread lib/compiler.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block should be run only when definition.sourceFile is defined. Please add a unit-test covering this case too.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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...

@bajtos

bajtos commented Mar 10, 2015

Copy link
Copy Markdown
Member

@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.

@shlomiassaf

Copy link
Copy Markdown
Contributor Author

@bajtos ,

Addressed your notes.

I pushed them before signing the CLA so the link is lost.
You can supply one or I can wait for the CLAHUB fail.

Thanks.

@bajtos

bajtos commented Mar 12, 2015

Copy link
Copy Markdown
Member

@bajtos

bajtos commented Mar 12, 2015

Copy link
Copy Markdown
Member

@slnode test please

@shlomiassaf

Copy link
Copy Markdown
Contributor Author

@bajtos,

Can we land this?

Comment thread lib/compiler.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bajtos

bajtos commented Mar 23, 2015

Copy link
Copy Markdown
Member

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.

@bajtos bajtos added the waiting label Mar 30, 2015
@bajtos

bajtos commented Mar 30, 2015

Copy link
Copy Markdown
Member

@shlomiassaf ping, what's the status of this patch? Are you still keen to finish it?

@shlomiassaf

Copy link
Copy Markdown
Contributor Author

@bajtos , sorry for the delay, work pressure.

Will do my best to finish this week, thanks for the update.

@shlomiassaf

Copy link
Copy Markdown
Contributor Author

@bajtos, you can run tests

@bajtos

bajtos commented Apr 2, 2015

Copy link
Copy Markdown
Member

@slnode ok to test

@bajtos

bajtos commented Apr 2, 2015

Copy link
Copy Markdown
Member

@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.

@bajtos

bajtos commented Apr 9, 2015

Copy link
Copy Markdown
Member

@shlomiassaf would you mind rebasing your patch on top of the current master branch and fixing the merge conflicts?

@bajtos bajtos added waiting and removed waiting labels Apr 9, 2015
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

Successfully merging this pull request may close these issues.

4 participants