clever-orm
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -25,3 +25,3 @@ var path = require( 'path' ) | ||
if ( !ModelType || !Models ) { | ||
if ( !ModelType || !Models || ModelType.type !== 'ORM' ) { | ||
return cb(); | ||
@@ -28,0 +28,0 @@ } |
'use strict'; | ||
var fs = require( 'fs' ) | ||
, path = require( 'path' ) | ||
var fs = require( 'fs' ) | ||
, path = require( 'path' ) | ||
, pkgJson = require( path.resolve( path.join( __dirname, '..', '..', 'package.json') ) ) | ||
, odmEnabled = pkgJson.bundledDependencies.indexOf( 'clever-odm' ) !== -1; | ||
@@ -61,6 +63,6 @@ module.exports = function( grunt ) { | ||
exec: { | ||
rebase: { | ||
ormRebase: { | ||
cmd: "NODE_PATH=./lib/:./modules/; node modules/clever-orm/bin/rebase.js " + dbTarget | ||
}, | ||
seed: { | ||
ormSeed: { | ||
cmd: "NODE_PATH=./lib/:./modules/; node modules/clever-orm/bin/seedModels.js " + dbTarget | ||
@@ -73,7 +75,17 @@ } | ||
// Register each command | ||
grunt.registerTask( 'db:rebase', [ 'exec:rebase' ] ); | ||
grunt.registerTask( 'db:seed', [ 'exec:seed' ] ); | ||
grunt.registerTask( 'db:ormRebase', [ 'exec:ormRebase' ] ); | ||
grunt.registerTask( 'db:ormSeed', [ 'exec:ormSeed' ] ); | ||
// Register grouped command | ||
grunt.registerTask( 'db:orm', [ 'db:ormRebase', 'db:ormSeed' ] ); | ||
// Register db command (runs one after the other) | ||
grunt.registerTask( 'db', [ 'db:rebase', 'db:seed' ] ); | ||
if ( odmEnabled ) { | ||
grunt.registerTask( 'db:rebase', [ 'db:ormRebase', 'db:odmRebase' ] ); | ||
grunt.registerTask( 'db:seed', [ 'db:ormSeed', 'db:odmSeed' ] ); | ||
grunt.registerTask( 'db', [ 'db:rebase', 'db:seed' ] ); | ||
} else { | ||
grunt.registerTask( 'db:rebase', [ 'db:ormRebase' ] ); | ||
grunt.registerTask( 'db:seed', [ 'db:ormSeed' ] ); | ||
grunt.registerTask( 'db', [ 'db:orm' ] ); | ||
} | ||
@@ -80,0 +92,0 @@ grunt.registerTask( 'readme', 'Displays helpful information', function ( ) { |
{ | ||
"name": "clever-orm", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "mysql": "2.0.0-rc2", |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
40711
812
12