Skip to content

Commit

Permalink
Merge pull request #43 from waterfoul/createBatch
Browse files Browse the repository at this point in the history
Fixing the field names of the related fields
  • Loading branch information
waterfoul authored Sep 1, 2016
2 parents ae33590 + 2da69f2 commit b05de01
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions node/relationships/ManyToOne.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export class ManyToOne<T extends DataContract> extends Relationship<T, T> {
(targetModel: sequelize.Model<any, any>) => {
try {
this.idName = (<any> targetModel).name + 'Id';
this.idName = this.idName.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); });

if ((<any> this.parent).instance) {
(<any> this.parent).instance.set(this.idName, newModel && newModel.id);
Expand Down
1 change: 1 addition & 0 deletions node/relationships/OneToOne.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export class OneToOne<T extends DataContract> extends Relationship<T, T> {
(targetModel: sequelize.Model<any, any>) => {
try {
this.idName = (<any> targetModel).name + 'Id';
this.idName = this.idName.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); });

if ((<any> this.parent).instance) {
(<any> this.parent).instance.set(this.idName, newModel && newModel.id);
Expand Down

0 comments on commit b05de01

Please sign in to comment.