Skip to content

Commit b30e581

Browse files
authored
Embedded schema intro doc, minor edits (#3806)
1 parent bbf4589 commit b30e581

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

guides/introduction/Embedded Schemas.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ defmodule UserProfile do
9595
end
9696
```
9797

98-
It is important to remember that `embedded_schema` has many use cases independent of `embeds_one` and `embeds_many`. You can think of them as a persistence agnostic `schema`. This makes embedded schemas ideal for scenarios where you want to manage structured data without necessarily persisting it. For example, if you want to build a contact form, you still want to parse and validate the data, but the data is likely not persisted anywhere. Instead, it is used to send an email. Embedded schemas would be a good fit for such use case.
98+
It is important to remember that `embedded_schema` has many use cases independent of `embeds_one` and `embeds_many`. You can think of embedded schemas as persistence agnostic `schema`s. This makes embedded schemas ideal for scenarios where you want to manage structured data without necessarily persisting it. For example, if you want to build a contact form, you still want to parse and validate the data, but the data is likely not persisted anywhere. Instead, it is used to send an email. Embedded schemas would be a good fit for such a use case.
9999

100100
### Migrations
101101

@@ -196,7 +196,7 @@ user_changeset = User.changeset(%User{}, %{profile: %{online: true, visibility:
196196
(Ecto.Query.from u in User, select: {u.profile["online"], u.profile["visibility"]}) |> Repo.one
197197
# => {true, "public"}
198198

199-
(Ecto.Query.from u in User, select: u.profile, where: u.profile["visibility"] == :public) |> Repo.all
199+
(Ecto.Query.from u in User, select: u.profile, where: u.profile["visibility"] == ^:public) |> Repo.all
200200
# => [
201201
# %UserProfile{
202202
# id: "...",

0 commit comments

Comments
 (0)