-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add support for mongoDb id's + make collection to lowercase work #56
base: master
Are you sure you want to change the base?
Conversation
_.each is not changing the value of collections. So I replaced it with _.map
index.js
Outdated
@@ -71,6 +71,9 @@ Barrels.prototype.associate = function(collections, done) { | |||
Model.findOne(that.idMap[modelName][itemIndex]).exec(function(err, model) { | |||
if (err) | |||
return nextItem(err); | |||
|
|||
if(!model) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what space?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space after if
. It's really not a big deal, but let's stay consistent.
index.js
Outdated
else { | ||
for (var j = 0; j < item[attr].length; j++) { | ||
model[attr].add(that.idMap[joined][item[attr][j]-1]); | ||
var idx = that.idMap[joined].indexOf(item[attr][j]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation, please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
package.json
Outdated
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "barrels", | |||
"version": "1.6.5", | |||
"version": "1.6.7", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you skipping a version? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
made changes twice, so upped the version twice. downgraded the version on my code now, so it will be upped only once on your side.
Assosiations functions update + Populate function update to use find function, and add a checkes for array of ids have related objects, and not fail.
switching to !isNaN
All Updated. Ready to pull. |
Any update? |
No description provided.