clever-orm
Advanced tools
Comparing version 1.0.12 to 1.1.0
@@ -66,3 +66,3 @@ var injector = require( 'injector' ) | ||
var as = i.camelize( i[ association.associationType === 'HasMany' ? 'pluralize' : 'singularize' ]( association.as ), false ); | ||
var as = i[ association.associationType === 'HasMany' ? 'pluralize' : 'singularize' ]( association.as ); | ||
models[ association.source.name ]._getters[ as ] = function() { | ||
@@ -86,2 +86,10 @@ return this._model[ as ]; | ||
if ( where._model ) { | ||
where = where._model; | ||
} else if ( where instanceof Array && where[ 0 ]._model ) { | ||
where = where.map( function( _model ) { | ||
return _model._model; | ||
}); | ||
} | ||
this._model[ accessor ]( where, options ) | ||
@@ -116,2 +124,7 @@ .success( function( _model ) { | ||
this.debug( '%s %s %s with second argument of ', modelName, assocType, assocTo[0], assocTo[1] ); | ||
if ( assocTo[ 1 ].through ) { | ||
assocTo[ 1 ].through = this.models[ assocTo[ 1 ].through.replace( 'Model', '' ) ]; | ||
} | ||
this.models[ modelName ][ assocType ]( this.models[ assocTo[0] ], assocTo[1] ); | ||
@@ -118,0 +131,0 @@ } else { |
{ | ||
"name": "clever-orm", | ||
"description": "CleverStack ORM (SQL) Module", | ||
"version": "1.0.12", | ||
"version": "1.1.0", | ||
"main": "module.js", | ||
@@ -36,3 +36,3 @@ "author": { | ||
"mysql": "2.0.0-rc2", | ||
"sequelize": "^1.7.x" | ||
"sequelize": "~2.0.0-rc1" | ||
}, | ||
@@ -39,0 +39,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54775
988
+ Addedbluebird@2.4.2(transitive)
+ Addeddottie@0.3.1(transitive)
+ Addedgeneric-pool@2.1.1(transitive)
+ Addedinflection@1.13.4(transitive)
+ Addedlodash@3.10.1(transitive)
+ Addedmoment@2.30.1(transitive)
+ Addedsequelize@2.0.6(transitive)
+ Addedvalidator@3.43.0(transitive)
- Removedbluebird@1.0.8(transitive)
- Removedcircular-json@0.1.6(transitive)
- Removedcommander@2.1.0(transitive)
- Removeddottie@0.1.0(transitive)
- Removedgeneric-pool@2.0.4(transitive)
- Removedlingo@0.0.5(transitive)
- Removedlodash@1.3.12.4.2(transitive)
- Removedmoment@2.5.1(transitive)
- Removedsequelize@1.7.11(transitive)
- Removedsliced@0.0.5(transitive)
- Removedsql@0.35.0(transitive)
- Removedunderscore.string@2.3.3(transitive)
- Removedvalidator@3.2.1(transitive)
- Removedwru@0.3.0(transitive)
Updatedsequelize@~2.0.0-rc1