Skip to content

Commit fe489ec

Browse files
Merge pull request #125 from RobinBuschmann/issue-121
fixes #121
2 parents 000fbb1 + 2f85c3c commit fe489ec

File tree

5 files changed

+21
-20
lines changed

5 files changed

+21
-20
lines changed

lib/interfaces/ISequelizeUriConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export interface ISequelizeUriConfig extends Options {
55
/**
66
* Uri connection string to database
77
*/
8-
uri: string;
8+
url: string;
99

1010
/**
1111
* Path to models, which should be loaded

lib/models/BaseSequelize.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export abstract class BaseSequelize {
2828
}
2929

3030
static isISequelizeUriConfig(obj: any): obj is ISequelizeUriConfig {
31-
return obj.hasOwnProperty("uri");
31+
return obj.hasOwnProperty("url");
3232
}
3333

3434
static extend(target: any): void {
@@ -79,7 +79,7 @@ export abstract class BaseSequelize {
7979
models.forEach(model => model.isInitialized = true);
8080
this.associateModels(models);
8181
resolveScopes(models);
82-
installHooks​​(models);
82+
installHooks(models);
8383
models.forEach(model => this._[model.name] = model);
8484
}
8585

lib/models/v3/Sequelize.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ export class Sequelize extends SequelizeOrigin implements BaseSequelize {
2121

2222
constructor(config: SequelizeConfig | string) {
2323
if (typeof config === "string") {
24-
super(config)
25-
} else if(BaseSequelize.isISequelizeUriConfig(config)) {
26-
super(config.uri, config)
24+
super(config);
25+
} else if (BaseSequelize.isISequelizeUriConfig(config)) {
26+
super(config.url, config);
2727
} else {
28-
super(BaseSequelize.prepareConfig(config))
28+
super(BaseSequelize.prepareConfig(config));
2929
}
3030

31-
this.throughMap = {}
32-
this._ = {}
33-
this.Model = Function
31+
this.throughMap = {};
32+
this._ = {};
33+
this.Model = Function;
3434

3535
if (typeof config !== "string") {
3636
this.init(config);

lib/models/v4/Sequelize.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@ import {ISequelizeAssociation} from "../../interfaces/ISequelizeAssociation";
99

1010
export class Sequelize extends OriginSequelize implements BaseSequelize {
1111

12-
throughMap: {[through: string]: any};
13-
_: {[modelName: string]: typeof Model};
12+
throughMap: { [through: string]: any };
13+
_: { [modelName: string]: typeof Model };
1414
init: (config: SequelizeConfig) => void;
1515
addModels: (models: Array<typeof Model> | string[]) => void;
1616
associateModels: (models: Array<typeof Model>) => void;
1717

1818
constructor(config: SequelizeConfig | string) {
1919
if (typeof config === "string") {
20-
super(config)
21-
} else if(BaseSequelize.isISequelizeUriConfig(config)) {
22-
super(config.uri, config)
20+
super(config);
21+
} else if (BaseSequelize.isISequelizeUriConfig(config)) {
22+
super(config.url, config);
2323
} else {
24-
super(BaseSequelize.prepareConfig(config))
24+
super(BaseSequelize.prepareConfig(config));
2525
}
2626

27-
this.throughMap = {}
28-
this._ = {}
27+
this.throughMap = {};
28+
this._ = {};
2929

3030
if (typeof config !== "string") {
3131
this.init(config);
@@ -42,7 +42,8 @@ export class Sequelize extends OriginSequelize implements BaseSequelize {
4242
return Through;
4343
}
4444

45-
adjustAssociation(model: any, association: ISequelizeAssociation): void {}
45+
adjustAssociation(model: any, association: ISequelizeAssociation): void {
46+
}
4647

4748
/**
4849
* Creates sequelize models and registers these models

test/specs/models/sequelize.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ describe('sequelize', () => {
5656
describe('constructor using uri in options object', () => {
5757

5858
const sequelizeUri = new Sequelize({
59-
uri: connectionUri,
59+
url: connectionUri,
6060
storage: ':memory:',
6161
logging: !('SEQ_SILENT' in process.env),
6262
pool: {max: 8, min: 0}

0 commit comments

Comments
 (0)