From bd6750b814e8b76464b6f982764301bb4a094602 Mon Sep 17 00:00:00 2001 From: Greg Date: Sun, 3 Nov 2024 07:03:52 -0500 Subject: [PATCH] clearer wording --- guides/howtos/Data mapping and validation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/howtos/Data mapping and validation.md b/guides/howtos/Data mapping and validation.md index f79f16db16..bf83e7a29c 100644 --- a/guides/howtos/Data mapping and validation.md +++ b/guides/howtos/Data mapping and validation.md @@ -101,7 +101,7 @@ end In the example above, by breaking apart the mapping between the database and Elixir and between Elixir and the UI, our code becomes clearer and our data structures simpler. -Note we have used `MyApp.Repo.insert_all/2` to add data to both "accounts" and "profiles" tables directly. We have chosen to bypass schemas altogether. However, there is nothing stopping you from also defining both `Account` and `Profile` schemas and changing `to_account/1` and `to_profile/1` to respectively return `%Account{}` and `%Profile{}` structs. Once structs are returned, they could be inserted through the usual `MyApp.Repo.insert/2` operation. One can also check for uniqueness or other constraints during insertion by using the structs in a changeset. +Note we have used `MyApp.Repo.insert_all/2` to add data to both "accounts" and "profiles" tables directly. We have chosen to bypass schemas altogether. However, there is nothing stopping you from also defining both `Account` and `Profile` schemas and changing `to_account/1` and `to_profile/1` to respectively return `%Account{}` and `%Profile{}` structs. Once structs are returned, they could be inserted through the usual `MyApp.Repo.insert/2` operation. One can also check for uniqueness or other constraints during insertion by wrapping the structs in a changeset. ## Schemaless changesets