Skip to content

Commit 6d84ced

Browse files
committed
docs: fix styling issue with long comments
1 parent cf5aeea commit 6d84ced

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

docs/associations.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -788,15 +788,19 @@ Note that the Image -> Comment and Post -> Comment relations define a scope, `co
788788

789789
```js
790790
image.getComments()
791-
// SELECT "id", "title", "commentable", "commentableId", "createdAt", "updatedAt" FROM "comments" AS "comment" WHERE "comment"."commentable" = 'image' AND "comment"."commentableId" = 1;
791+
// SELECT "id", "title", "commentable", "commentableId", "createdAt", "updatedAt" FROM "comments" AS
792+
// "comment" WHERE "comment"."commentable" = 'image' AND "comment"."commentableId" = 1;
792793

793794
image.createComment({
794795
title: 'Awesome!'
795796
})
796-
// INSERT INTO "comments" ("id","title","commentable","commentableId","createdAt","updatedAt") VALUES (DEFAULT,'Awesome!','image',1,'2018-04-17 05:36:40.454 +00:00','2018-04-17 05:36:40.454 +00:00') RETURNING *;
797+
// INSERT INTO "comments" ("id","title","commentable","commentableId","createdAt","updatedAt") VALUES
798+
// (DEFAULT,'Awesome!','image',1,'2018-04-17 05:36:40.454 +00:00','2018-04-17 05:36:40.454 +00:00')
799+
// RETURNING *;
797800

798801
image.addComment(comment);
799-
// UPDATE "comments" SET "commentableId"=1,"commentable"='image',"updatedAt"='2018-04-17 05:38:43.948 +00:00' WHERE "id" IN (1)
802+
// UPDATE "comments" SET "commentableId"=1,"commentable"='image',"updatedAt"='2018-04-17 05:38:43.948
803+
// +00:00' WHERE "id" IN (1)
800804
```
801805

802806
The `getItem` utility function on `Comment` completes the picture - it simply converts the `commentable` string into a call to either `getImage` or `getPost`, providing an abstraction over whether a comment belongs to a post or an image. You can pass a normal options object as a parameter to `getItem(options)` to specify any where conditions or includes.

docs/data-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ Timeline.create({ range: [null, new Date(Date.UTC(2016, 0, 1))] });
162162
Timeline.create({ range: [-Infinity, new Date(Date.UTC(2016, 0, 1))] });
163163
```
164164

165-
# Extending datatypes
165+
## Extending datatypes
166166

167167
Most likely the type you are trying to implement is already included in [DataTypes](/manual/data-types.html). If a new datatype is not included, this manual will show how to write it yourself.
168168

docs/models-usage.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ User
4545
console.log(created)
4646

4747
/*
48-
findOrCreate returns an array containing the object that was found or created and a boolean that will be true if a new object was created and false if not, like so:
48+
findOrCreate returns an array containing the object that was found or created and a boolean that
49+
will be true if a new object was created and false if not, like so:
4950
5051
[ {
5152
username: 'sdepold',
@@ -56,7 +57,10 @@ User
5657
},
5758
true ]
5859
59-
In the example above, the array spread on line 3 divides the array into its 2 parts and passes them as arguments to the callback function defined beginning at line 39, which treats them as "user" and "created" in this case. (So "user" will be the object from index 0 of the returned array and "created" will equal "true".)
60+
In the example above, the array spread on line 3 divides the array into its 2 parts and passes them
61+
as arguments to the callback function defined beginning at line 39, which treats them as "user" and
62+
"created" in this case. (So "user" will be the object from index 0 of the returned array and
63+
"created" will equal "true".)
6064
*/
6165
})
6266
```
@@ -82,7 +86,10 @@ User.create({ username: 'fnord', job: 'omnomnom' })
8286
},
8387
false
8488
]
85-
The array returned by findOrCreate gets spread into its 2 parts by the array spread on line 3, and the parts will be passed as 2 arguments to the callback function beginning on line 69, which will then treat them as "user" and "created" in this case. (So "user" will be the object from index 0 of the returned array and "created" will equal "false".)
89+
The array returned by findOrCreate gets spread into its 2 parts by the array spread on line 3, and
90+
the parts will be passed as 2 arguments to the callback function beginning on line 69, which will
91+
then treat them as "user" and "created" in this case. (So "user" will be the object from index 0
92+
of the returned array and "created" will equal "false".)
8693
*/
8794
})
8895
```

0 commit comments

Comments
 (0)