Permalink
Browse files

feat(mapping): Table name to underscore

  • Loading branch information...
Rawphs
Rawphs committed Oct 29, 2016
1 parent 2c57e6b commit 099047a784198ea205f158d92b4a84e14da9a35c
Showing with 13 additions and 2 deletions.
  1. +13 −2 src/Mapping.ts
@@ -274,13 +274,24 @@ export class Mapping<T> {
* @return {Mapping}
*/
public entity(options: Object = {}): this {
let entityManager = this.stageOrGetManager('entity', arguments);
if (!entityManager) {
return;
}
let toUnderscore = this.entityManager.getConfig().fetch('mapping.defaultNamesToUnderscore');
let tableName = toUnderscore ? this.nameToUnderscore(this.target.name) : this.target.name.toLowerCase();
let defaultMapping = {
repository: EntityRepository,
name : this.target.name,
tableName : this.target.name.toLowerCase(),
tableName : tableName,
store : null
};
console.log(toUnderscore);
console.log(defaultMapping);
console.log('--------------');
Homefront.merge(this.mapping.fetchOrPut(`entity`, defaultMapping), options);
return this;

0 comments on commit 099047a

Please sign in to comment.