Comparing version 0.7.1 to 0.7.2
@@ -298,11 +298,14 @@ !function () { | ||
, _prepareChildrenForRootResource: function(resource) { | ||
//log.highlight('%s hasChildren: %s', resource.name, resource.hasChildren()); | ||
// we nede to apply our filter to all parent queries | ||
// execpt for the root resource (thats happened already) | ||
// all subselects need to be filtered in the same way as | ||
// the parent was filtered | ||
this.applyFiltersToParents(resource.getParent(), resource); | ||
if (resource.hasChildren()) { | ||
resource.getChildren().forEach(function(childResource) { | ||
// we nede to apply our filter to all parent queries | ||
// execpt for the root resource (thats happened already) | ||
// all subselects need to be filtered in the same way as | ||
// the parent was filtered | ||
this.applyFiltersToParents(this.getParent(), this); | ||
@@ -387,2 +390,8 @@ // select | ||
/*log.warn('%s is applying its filters to the target %s; hasFiltersForTheRootResource %s; currentTargetResource %s; !currentTargetResource.isRootResource %s; !sourceResource.parentsFiltered %s;' | ||
, sourceResource.name | ||
, currentTargetResource ? currentTargetResource.name : undefined | ||
, sourceResource.hasFiltersForTheRootResource() | ||
, !!currentTargetResource, currentTargetResource ? !currentTargetResource.isRootResource() : undefined | ||
, !sourceResource.parentsFiltered);*/ | ||
@@ -389,0 +398,0 @@ // has filter, current target is not root, filters not yet applied |
{ | ||
"name" : "ee-orm" | ||
, "description" : "An easy to use ORM for node.js. Supports eager loading, complex queries, joins, transactions, complex database clusters & connection pooling." | ||
, "version" : "0.7.1" | ||
, "description" : "ORM for node.js supporting postgres or mysql. Supports eager loading, complex queries, joins, transactions, complex database clusters & connection pooling." | ||
, "version" : "0.7.2" | ||
, "homepage" : "https://github.com/eventEmitter/ee-orm" | ||
@@ -6,0 +6,0 @@ , "author" : "Michael van der Weg <michael@eventemitter.com> (http://eventemitter.com/)" |
33
test.js
@@ -12,3 +12,3 @@ | ||
orm.on('load', function(err) { | ||
var db = orm.ee_orm_test | ||
var db = orm.eventbooster | ||
, start | ||
@@ -27,24 +27,13 @@ , count = 0 | ||
db.condition(['*']) | ||
.fetchConditionType(['*']) | ||
.getCondition_tenant(['*']) | ||
.getArticle_conditionTenant(['*']) | ||
.getArticleInstanceCart_articleConditionTenant(['*']) | ||
.fetchConditionStatus(['*']) | ||
.getArticleInstance_cart(['*']) | ||
.getCart({ | ||
id: 356 | ||
}).find(log); | ||
var query = db.event(['*']) | ||
, qb = query.queryBuilder(); | ||
qb.and({ | ||
id: ORM.gt(0) | ||
} | ||
, qb.or({ | ||
'venue.name': ORM.like('re%') | ||
, 'venue.id_image': 5 | ||
} | ||
, qb.and({ | ||
'venue.municipality.county.country.code': 'ch' | ||
, 'venue.municipality.county.code': 'be' | ||
}) | ||
) | ||
); | ||
query.find(log); | ||
}); |
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
259462
4980