Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure inclusion filter is applied to the target model #476

Merged
merged 1 commit into from
Mar 2, 2015

Conversation

raymondfeng
Copy link
Contributor

/to @ritch or @bajtos
/cc @superkhau

The PR ensures the scope on include is applied to the target model instead of the through model.

See strongloop/loopback#1076


it('should apply inclusion fields to the target model', function(done) {
Article.create({title: 'a1'}, function (e, article) {
should.not.exist(e);
Copy link
Member

Choose a reason for hiding this comment

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

Consider replacing should.not.exist(e) with if (e) return done(e);. The latter gives much more helpful error message.

@bajtos
Copy link
Member

bajtos commented Mar 2, 2015

I cannot evaluate changes in the production code, it looks like a magic and a mud of ball at the same time to me. Considering that you have added new tests for the stuff you are fixing and all existing tests are passing, the patch LGTM as far as I am concerned.

@superkhau
Copy link
Contributor

@bajtos LOL, I thought it was a ball of mud too before finally giving up and asking @raymondfeng for help. ;) Glad I wasn't the only one.

raymondfeng added a commit that referenced this pull request Mar 2, 2015
Make sure inclusion filter is applied to the target model
@raymondfeng raymondfeng merged commit 4bbbf79 into master Mar 2, 2015
@raymondfeng raymondfeng deleted the feature/fix-lb-1076 branch March 2, 2015 19:04
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.

3 participants