Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
feat(validator): Add validation rule for associations to validator
- Loading branch information
Showing
with
7 additions
and
0 deletions.
-
+7
−0
src/index.js
|
|
@@ -1,8 +1,11 @@ |
|
|
import {EntityManager} from './entity-manager'; |
|
|
import {ValidationGroup} from 'aurelia-validation'; |
|
|
import {HasAssociationValidationRule} from './validator/has-association'; |
|
|
|
|
|
export {DefaultRepository} from './default-repository'; |
|
|
export {Repository} from './repository'; |
|
|
export {Entity} from './entity'; |
|
|
export {OrmMetadata} from './orm-metadata'; |
|
|
export {EntityManager} from './entity-manager'; |
|
|
export {association} from './decorator/association'; |
|
|
export {resource} from './decorator/resource'; |
|
@@ -14,4 +17,8 @@ export function configure(aurelia, configCallback) { |
|
|
let entityManagerInstance = aurelia.container.get(EntityManager); |
|
|
|
|
|
configCallback(entityManagerInstance); |
|
|
|
|
|
ValidationGroup.prototype.hasAssociation = function() { |
|
|
return this.isNotEmpty().passesRule(new HasAssociationValidationRule()); |
|
|
}; |
|
|
} |