Skip to content

Commit 3b2cfbf

Browse files
Merge pull request #114 from AlbertLochmueller/patch-1
Small language correction :)
2 parents 2d15b23 + cc80f37 commit 3b2cfbf

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ class Person extends Model<Person> {
6161
hobbies: Hobby[];
6262
}
6363
```
64-
The model needs to extend the `Model` class and has to be annotated with the `@Table` decorator. All properties, that
65-
should appear as a column in the database, require the `@Column` annotation.
64+
The model needs to extend the `Model` class and has to be annotated with the `@Table` decorator. All properties that
65+
should appear as a column in the database require the `@Column` annotation.
6666

6767
### `@Table`
6868
The `@Table` annotation can be used without passing any parameters. To specify some more define options, use
@@ -111,7 +111,7 @@ Decorator | Description
111111
`@DeletedAt` | sets `timestamps=true`, `paranoid=true` and `deletedAt='deletionDate'`
112112

113113
### `@Column`
114-
The `@Column` annotation can be used without passing any parameters. But therefore it is necessary, that
114+
The `@Column` annotation can be used without passing any parameters. But therefore it is necessary that
115115
the js type can be inferred automatically (see [Type inference](#type-inference) for details).
116116
```typescript
117117
@Column
@@ -201,8 +201,8 @@ const sequelize = new Sequelize({
201201
modelPaths: [__dirname + '/models']
202202
});
203203
```
204-
Before you can use your models, you have to tell sequelize where they can be found. So either set `modelPaths` in the
205-
sequlize config or add the required models later on by calling `sequelize.addModels([Person])` or
204+
Before you can use your models you have to tell sequelize where they can be found. So either set `modelPaths` in the
205+
sequelize config or add the required models later on by calling `sequelize.addModels([Person])` or
206206
`sequelize.addModels([__dirname + '/models'])`:
207207

208208
```typescript
@@ -233,7 +233,7 @@ person.save();
233233
```
234234

235235
### Find and update
236-
Finding and updating entries do also work like using native sequelize. So see sequelize
236+
Finding and updating entries does also work like using native sequelize. So see sequelize
237237
[docs](http://docs.sequelizejs.com/manual/tutorial/models-usage.html) for more details.
238238
```typescript
239239
Person
@@ -340,7 +340,7 @@ Decorator | Description
340340
`@BelongsTo(relatedModelGetter: () => typeof Model, options: AssociationOptionsBelongsTo)` | sets `SourceModel.belongsTo(RelatedModel, ...)` while `as` is key of annotated property and `options` are additional association options
341341
`@HasMany(relatedModelGetter: () => typeof Model)` | sets `SourceModel.hasMany(RelatedModel, ...)` while `as` is key of annotated property and `foreignKey` is resolved from target related class
342342
`@HasMany(relatedModelGetter: () => typeof Model, foreignKey: string)` | sets `SourceModel.hasMany(RelatedModel, ...)` while `as` is key of annotated property and `foreignKey` is explicitly specified value
343-
`@HasMany(relatedModelGetter: () => typeof Model, options: AssociationOptionsHasMany)` | sets `SourceModel.hasMany(RelatedModel, ...)` while `as` is key of annotated property and `options` are additional association otions
343+
`@HasMany(relatedModelGetter: () => typeof Model, options: AssociationOptionsHasMany)` | sets `SourceModel.hasMany(RelatedModel, ...)` while `as` is key of annotated property and `options` are additional association options
344344
`@HasOne(relatedModelGetter: () => typeof Model)` | sets `SourceModel.hasOne(RelatedModel, ...)` while `as` is key of annotated property and `foreignKey` is resolved from target related class
345345
`@HasOne(relatedModelGetter: () => typeof Model, foreignKey: string)` | sets `SourceModel.hasOne(RelatedModel, ...)` while `as` is key of annotated property and `foreignKey` is explicitly specified value
346346
`@HasOne(relatedModelGetter: () => typeof Model, options: AssociationOptionsHasOne)` | sets `SourceModel.hasOne(RelatedModel, ...)` while `as` is key of annotated property and `options` are additional association options
@@ -350,7 +350,7 @@ Decorator | Description
350350
`@BelongsToMany(relatedModelGetter: () => typeof Model, through: string, foreignKey: string, otherKey: string)` | sets `SourceModel.belongsToMany(RelatedModel, {through: throughString, ...})` while `as` is key of annotated property and `foreignKey`/`otherKey` are explicitly specified values
351351
`@BelongsToMany(relatedModelGetter: () => typeof Model, through: string, options: AssociationOptionsBelongsToMany)` | sets `SourceModel.belongsToMany(RelatedModel, {through: throughString, ...})` while `as` is key of annotated property and `options` are additional association values, including `foreignKey` and `otherKey`.
352352

353-
Note that when using AssociationOptions, certain properties will be overwritten when the association is built based on reflection metadata or explicit attribute parameters. For example, `as` will always be the annotated property's name, and `through` will be the explicitly stated value.
353+
Note that when using AssociationOptions, certain properties will be overwritten when the association is built, based on reflection metadata or explicit attribute parameters. For example, `as` will always be the annotated property's name, and `through` will be the explicitly stated value.
354354

355355
### Multiple relations of same models
356356
*sequelize-typescript* resolves the foreign keys by identifying the corresponding class references.
@@ -407,7 +407,7 @@ explicitly:
407407
With the creation of a relation, sequelize generates some method on the corresponding
408408
models. So when you create a 1:n relation between `ModelA` and `ModelB`, an instance of `ModelA` will
409409
have the functions `getModelBs`, `setModelBs`, `addModelB`, `removeModelB`, `hasModelB`. These functions still exist with *sequelize-typescript*.
410-
But TypeScript will not know of them and in turn will complain, when you try to access `getModelB`, `setModelB` or
410+
But TypeScript wont recognize them and will complain if you try to access `getModelB`, `setModelB` or
411411
`addModelB`. To make TypeScript happy, the `Model.prototype` of *sequelize-typescript* has `$set`, `$get`, `$add`
412412
functions.
413413
```typescript
@@ -425,7 +425,7 @@ class ModelB extends Model<ModelB> {
425425
a: ModelA;
426426
}
427427
```
428-
To use them pass the property key of the respective relation as the first parameter:
428+
To use them, pass the property key of the respective relation as the first parameter:
429429
```typescript
430430
const modelA = new ModelA();
431431

@@ -442,7 +442,7 @@ modelA.$create('bs', /* value */ ).then( /* ... */);
442442
Validation options can be set through the `@Column` annotation, but if you prefer to use separate decorators for
443443
validation instead, you can do so by simply adding the validate options *as* decorators:
444444
So that `validate.isEmail=true` becomes `@IsEmail`, `validate.equals='value'` becomes `@Equals('value')`
445-
and so on. Please notice, that a validator, that expects a boolean, is translated to an annotation without a parameter.
445+
and so on. Please notice that a validator that expects a boolean is translated to an annotation without a parameter.
446446

447447
See sequelize [docs](http://docs.sequelizejs.com/manual/tutorial/models-definition.html#validations)
448448
for all validators.
@@ -511,8 +511,8 @@ export class Shoe extends Model<Shoe> {
511511
```
512512

513513
## Scopes
514-
Scopes can be defined with annotations as well. The scope options are mostly the same like in native
515-
sequelize except of the way how model classes are referenced. So instead of referencing them directly a getter
514+
Scopes can be defined with annotations as well. The scope options are mostly identical to native
515+
sequelize except for the way model classes are referenced. So instead of referencing them directly a getter
516516
function `() => Model` is used instead.
517517
(See sequelize [docs](http://docs.sequelizejs.com/manual/tutorial/scopes.html) for more details)
518518

@@ -593,7 +593,7 @@ You cannot add one and the same model to multiple Sequelize instances with
593593
differently configured connections. So that one model will only work for one connection.
594594
### One model class per file
595595
This is not only good practice regarding design, but also matters for the order
596-
of execution. Since typescript creates a `__metadata("design:type", SomeModel)` call due to `emitDecoratorMetadata`
596+
of execution. Since Typescript creates a `__metadata("design:type", SomeModel)` call due to `emitDecoratorMetadata`
597597
compile option, in some cases `SomeModel` is probably not defined(not undefined!) and would throw a `ReferenceError`.
598598
When putting `SomeModel` in a separate file, it would look like `__metadata("design:type", SomeModel_1.SomeModel)`,
599599
which does not throw an error.
@@ -625,4 +625,4 @@ npm package maintainers to maintain their own typings, but Microsoft still has d
625625
accepting PR's and keeping quality high.
626626

627627
**Keep in mind `sequelize-typescript` does not provide typings for `sequelize`** - these are seperate things.
628-
A lot of the types in `sequelize-typescript` augment, refer to, or extends what sequelize already has.
628+
A lot of the types in `sequelize-typescript` augment, refer to, or extend what sequelize already has.

0 commit comments

Comments
 (0)