Comparing version 1.0.14 to 1.0.15
{ | ||
"name": "meadow", | ||
"version": "1.0.14", | ||
"version": "1.0.15", | ||
"description": "A data access library.", | ||
@@ -38,3 +38,3 @@ "main": "source/Meadow.js", | ||
"fable": "~1.0.1", | ||
"foxhound": "~1.0.8", | ||
"foxhound": "~1.0.9", | ||
"is-my-json-valid": "2.12.3", | ||
@@ -41,0 +41,0 @@ "mysql2": "0.15.8", |
@@ -67,3 +67,10 @@ // ##### Part of the **[retold](https://stevenvelozo.github.io/retold/)** system | ||
{ | ||
pQuery.query.IDUser = pMeadow.userIdentifier; | ||
if (!pQuery.query.IDUser) | ||
{ | ||
// The user ID is not already set, set it magically. | ||
if (typeof(pQuery.userID) === 'number' && (pQuery.userID % 1) === 0 && pQuery.userID >= 0) | ||
pQuery.query.IDUser = pQuery.userID; | ||
else | ||
pQuery.query.IDUser = pMeadow.userIdentifier; | ||
} | ||
@@ -70,0 +77,0 @@ // Merge in the default record with the passed-in record for completeness |
@@ -21,3 +21,10 @@ // ##### Part of the **[retold](https://stevenvelozo.github.io/retold/)** system | ||
{ | ||
pQuery.query.IDUser = pMeadow.userIdentifier; | ||
if (!pQuery.query.IDUser) | ||
{ | ||
// The user ID is not already set, set it magically. | ||
if (typeof(pQuery.userID) === 'number' && (pQuery.userID % 1) === 0 && pQuery.userID >= 0) | ||
pQuery.query.IDUser = pQuery.userID; | ||
else | ||
pQuery.query.IDUser = pMeadow.userIdentifier; | ||
} | ||
// Make sure the developer submitted a record | ||
@@ -24,0 +31,0 @@ if (!pQuery.query.records) |
@@ -18,5 +18,2 @@ // ##### Part of the **[retold](https://stevenvelozo.github.io/retold/)** system | ||
var _Fable = pFable; | ||
var _GlobalLogLevel = 0; | ||
if (_Fable.settings.MySQL) | ||
_GlobalLogLevel = _Fable.settings.MySQL.GlobalLogLevel || 0; | ||
@@ -67,4 +64,3 @@ /** | ||
// TODO: Test the query before executing | ||
if (pQuery.logLevel > 0 || | ||
_GlobalLogLevel > 0) | ||
if (pQuery.logLevel > 0) | ||
{ | ||
@@ -106,4 +102,3 @@ _Fable.log.trace(pQuery.query.body, pQuery.query.parameters); | ||
if (pQuery.logLevel > 0 || | ||
_GlobalLogLevel > 0) | ||
if (pQuery.logLevel > 0) | ||
{ | ||
@@ -134,4 +129,3 @@ _Fable.log.trace(pQuery.query.body, pQuery.query.parameters); | ||
if (pQuery.logLevel > 0 || | ||
_GlobalLogLevel > 0) | ||
if (pQuery.logLevel > 0) | ||
{ | ||
@@ -162,4 +156,3 @@ _Fable.log.trace(pQuery.query.body, pQuery.query.parameters); | ||
if (pQuery.logLevel > 0 || | ||
_GlobalLogLevel > 0) | ||
if (pQuery.logLevel > 0) | ||
{ | ||
@@ -198,4 +191,3 @@ _Fable.log.trace(pQuery.query.body, pQuery.query.parameters); | ||
if (pQuery.logLevel > 0 || | ||
_GlobalLogLevel > 0) | ||
if (pQuery.logLevel > 0) | ||
{ | ||
@@ -202,0 +194,0 @@ _Fable.log.trace(pQuery.query.body, pQuery.query.parameters); |
@@ -597,2 +597,25 @@ /** | ||
); | ||
test | ||
( | ||
'Create a record in the database with a defined creating user', | ||
function(fDone) | ||
{ | ||
var testMeadow = newMeadow(); | ||
var tmpQuery = testMeadow.query | ||
.setIDUser(800) | ||
.addRecord({Name:'MewSix', GUIDAnimal:'0x123456', Type:'Pokemon'}); | ||
testMeadow.doCreate(tmpQuery, | ||
function(pError, pQuery, pQueryRead, pRecord) | ||
{ | ||
// We should have a record .... | ||
Expect(pRecord.Name) | ||
.to.equal('MewSix'); | ||
Expect(pRecord.CreatingIDUser) | ||
.to.equal(800); | ||
fDone(); | ||
} | ||
) | ||
} | ||
); | ||
} | ||
@@ -599,0 +622,0 @@ ); |
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
129980
41
3104
Updatedfoxhound@~1.0.9