Skip to content

Commit 9feff0f

Browse files
Update chapters 05 and 06 (#81)
* Update chapter03-presenting-users.adoc Fix: Use correct password_digest field in test code. Fix: Typo. * Update chapter03-presenting-users.adoc Fix: Commit message for update action. * Fix casing in create Order model statement * Remove duplicated question from answers. * Expose order model, not user model.
1 parent 137a234 commit 9feff0f

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

rails6/en/chapter06-improve-json.adoc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,11 +1099,6 @@ Which following snippet is a valid JSON:API response?:: With product's user into
10991099
----
11001100
+
11011101

1102-
What is the purpose of `Hash#dig` method?::
1103-
. Get a nested element safer.
1104-
. Get a nested element and load Active Record relations if needed.
1105-
. Add a nested element safer.
1106-
11071102
What is the purpose of `Hash#dig` method?:: Get a nested element safer. It is a Ruby method allowing you to retrieve elements in a nested `Hash` by avoiding errors if an element is not present.
11081103

11091104
How do you include user information in a JSON:API output of a product?::

rails6/en/chapter07-placing-orders.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Let’s start by creating the older model with a special form:
3131

3232
[source,bash]
3333
----
34-
$ rails generate model order user:belongs_to total:decimal
34+
$ rails generate model Order user:belongs_to total:decimal
3535
----
3636

3737
The command above will generate the order model, but I’m taking advantage of the `belongs_to` column type to create the corresponding foreign key for the order to belong to a user. It also adds the `belongs_to` association into the order model. Let’s migrate the database.
@@ -166,7 +166,7 @@ $ git add . && git commit -m "Associates products and orders with a placements m
166166
----
167167

168168

169-
== Expose the user model
169+
== Expose the order model
170170

171171
It is now time to prepare the order controller to expose the right orders. If you remember the previous chapters where https://github.com/jsonapi-serializer/jsonapi-serializer[jsonapi-serializer] was used, you should remember that it was straightforward.
172172

0 commit comments

Comments
 (0)