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

Fix Model.count base implementation and Normalize/validate the query filter #130

Merged
merged 4 commits into from
Jun 4, 2014

Conversation

raymondfeng
Copy link
Contributor

The PR fixes two issues:

  1. Fix the count() base implementation using buildWhere() from the sub-class
  2. Add logic to normalize/validate the query filter object before delegating to connectors

/to @ritch
/to @bajtos (We'll need to merge them into the loopback-connector repo).

* @param {Object} filter The query filter object
* @returns {Object} The normalized filter object
* @private
*/
Copy link
Member

Choose a reason for hiding this comment

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

The best way for documenting private methods is to use

/**
 * (...)
 * @private
 */

That way IDEs like WebStorm can use the type information provided by jsdoc (thanks to /**), but the documentation is discarded by strong-docs (thanks to @private).

Comments starting with /*! are usually used for license boilerplate that should be preserved by minifiers in the output bundle.

@bajtos
Copy link
Member

bajtos commented Jun 3, 2014

@raymondfeng

We'll need to merge them into the loopback-connector repo.

Makes sense. Could you please review/approve loopbackio/loopback-connector#2 and submit a pull request with the changes you made to lib/sql.js?

BTW #127 is going delete lib/sql.js, I am not sure how much sense does it make to fix it in this patch.

@@ -999,10 +1077,11 @@ setRemoting(DataAccessObject.prototype.updateAttributes, {
http: {verb: 'put', path: '/'}
});

/**
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this required to remove from strong-docs? I'm pretty sure @private is supported.

@ritch
Copy link
Contributor

ritch commented Jun 4, 2014

Minor comments from me. Otherwise looks good 👍.

raymondfeng added a commit that referenced this pull request Jun 4, 2014
Fix Model.count base implementation and Normalize/validate the query filter
@raymondfeng raymondfeng merged commit ea5c766 into master Jun 4, 2014
@raymondfeng raymondfeng deleted the feature/fix-sql-count branch June 19, 2014 05:47
@bajtos bajtos mentioned this pull request Jun 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.

3 participants