Skip to content

Commit 92bf4dd

Browse files
authored
Update usage-rules.md
add link to polymorphic relationships guide
1 parent caa26df commit 92bf4dd

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

usage-rules.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Understanding Ash
44

5-
Ash is an opinionated, composable framework for building applications in Elixir. It provides a declarative approach to modeling your domain with resources at the center. Read documentation *before* attempting to use it's features. Do not assume that you have prior knowledge of the framework or its conventions.
5+
Ash is an opinionated, composable framework for building applications in Elixir. It provides a declarative approach to modeling your domain with resources at the center. Read documentation *before* attempting to use its features. Do not assume that you have prior knowledge of the framework or its conventions.
66

77
## Code Structure & Organization
88

@@ -479,14 +479,13 @@ end
479479
change {MyApp.Changes.ProcessOrder, []}
480480
```
481481

482-
## Anonymous Functions
482+
## Custom Modules vs. Anonymous Functions
483483

484484
Prefer to put code in its own module and refer to that in changes, preparations, validations etc.
485485

486486
For example, prefer this:
487487

488488
```elixir
489-
# in
490489
defmodule MyApp.MyDomain.MyResource.Changes.SlugifyName do
491490
use Ash.Resource.Change
492491

@@ -521,7 +520,7 @@ Relationships describe connections between resources and are a core component of
521520

522521
#### Relationship Types
523522

524-
- For Polymorphic relationships, you can model them using `Ash.Type.Union`; see the Polymorphic Relationships guide for more information.
523+
- For Polymorphic relationships, you can model them using `Ash.Type.Union`; see the [Polymorphic Relationships guide](https://hexdocs.pm/ash/polymorphic-relationships.html) for more information.
525524

526525
```elixir
527526
relationships do
@@ -597,7 +596,7 @@ Ash.load!(post, :author)
597596

598597
Prefer to use the `strict?` option when loading to only load necessary fields on related data.
599598

600-
```Elixir
599+
```elixir
601600
MyApp.Post
602601
|> Ash.Query.load([comments: [:title]], strict?: true)
603602
```

0 commit comments

Comments
 (0)