Skip to content

Commit a5646df

Browse files
authored
Fix some typos (#6386)
1 parent 14faee2 commit a5646df

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

guides/data_modelling/more_examples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ We generated an `Orders` context. The order is automatically scoped to the curre
3232
create table(:orders) do
3333
- add :total_price, :decimal
3434
+ add :total_price, :decimal, precision: 15, scale: 6, null: false
35-
add :user_id, references(:user, type: :id, on_delete: :delete_all)
35+
add :user_id, references(:users, type: :id, on_delete: :delete_all)
3636

3737
timestamps()
3838
end
@@ -316,4 +316,4 @@ Total price: $30.00
316316

317317
We haven't added payments, but we can already see how our `ShoppingCart` and `Orders` context splitting is driving us towards a maintainable solution. With our cart items separated from our order line items, we are well equipped in the future to add payment transactions, cart price detection, and more.
318318

319-
Great work!
319+
Great work!

guides/data_modelling/your_first_context.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ If we follow the "Back" link, we get a list of all products, which should contai
9999
>
100100
> For those reasons, Phoenix generators allow you to skip the context name, which is really helpful when you're stuck or still exploring your business domain. For example, our code above would work the same if we used the default `Products` context for managing products and it would still allow us to organically discover other resources that belong to the `Products` context, such as categories or image galleries.
101101
>
102-
> We also advise against being too smart when naming your contexts. Pick a name that is clear and obvious to everyone who works (and might work) in the project. As your applications grows and the different parts of your system become clear, you can simply rename the context or move resources around. The beauty of Elixir modules is moving them around should be simply a matter of renaming the module names and their callers (and renaming the files for consistency).
102+
> We also advise against being too smart when naming your contexts. Pick a name that is clear and obvious to everyone who works (and might work) in the project. As your application grows and the different parts of your system become clear, you can simply rename the context or move resources around. The beauty of Elixir modules is moving them around should be simply a matter of renaming the module names and their callers (and renaming the files for consistency).
103103
104104
## Grokking generated code
105105

@@ -177,7 +177,7 @@ defmodule Hello.Catalog do
177177
end
178178
```
179179

180-
This module will be the public API for all product catalog functionality in our system. For example, in addition to product detail management, we may also handle product category classification and product variants for things like optional sizing, trims, etc. If we look at the `list_products/0` function, we can see the private details of product fetching. And it's super simple. We have a call to `Repo.all(Product)`. We saw how Ecto repo queries worked in the [Ecto guide](ecto.html), so this call should look familiar. Our `list_products` function is a generalized function name specifying the *intent* of our code – namely to list products. The details of that intent where we use our Repo to fetch the products from our PostgreSQL database is hidden from our callers. This is a common theme we'll see re-iterated as we use the Phoenix generators. Phoenix will push us to think about where we have different responsibilities in our application, and then to wrap up those different areas behind well-named modules and functions that make the intent of our code clear, while encapsulating the details.
180+
This module will be the public API for all product catalog functionality in our system. For example, in addition to product detail management, we may also handle product category classification and product variants for things like optional sizing, trims, etc. If we look at the `list_products/0` function, we can see the private details of product fetching. And it's super simple. We have a call to `Repo.all(Product)`. We saw how Ecto repo queries worked in the [Ecto guide](ecto.html), so this call should look familiar. Our `list_products` function is a generalized function name specifying the *intent* of our code – namely to list products. The details of that intent where we use our Repo to fetch the products from our PostgreSQL database, are hidden from our callers. This is a common theme we'll see reiterated as we use the Phoenix generators. Phoenix will push us to think about where we have different responsibilities in our application, and then to wrap up those different areas behind well-named modules and functions that make the intent of our code clear, while encapsulating the details.
181181

182182
Now we know how data is fetched, but how are products persisted? Let's take a look at the `Catalog.create_product/1` function:
183183

@@ -298,4 +298,4 @@ UPDATE "products" AS p0 SET "views" = p0."views" + $1 WHERE (p0."id" = $2) RETUR
298298

299299
Good work!
300300

301-
As we've seen, designing with contexts gives you a solid foundation to grow your application from. Using discrete, well-defined APIs that expose the intent of your system allows you to write more maintainable applications with reusable code. Now that we know how to start extending our context API, lets explore handling relationships within a context.
301+
As we've seen, designing with contexts gives you a solid foundation to grow your application from. Using discrete, well-defined APIs that expose the intent of your system allows you to write more maintainable applications with reusable code. Now that we know how to start extending our context API, let's explore handling relationships within a context.

integration_test/test/code_generation/app_with_scopes_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ defmodule Phoenix.Integration.CodeGeneration.AppWithScopesTest do
238238
end
239239
240240
@doc """
241-
Creates a organization.
241+
Creates an organization.
242242
"""
243243
def create_organization(scope, attrs \\ %{}) do
244244
%Organization{}

0 commit comments

Comments
 (0)