mirror of
https://github.com/ash-project/ash_money.git
synced 2024-09-20 05:13:06 +12:00
docs: add "known types" docs
This commit is contained in:
parent
35a4342677
commit
c9d5020d6d
1 changed files with 11 additions and 1 deletions
|
@ -19,7 +19,17 @@ The primary thing that AshMoney provides is `AshMoney.Types.Money`. This is back
|
||||||
attribute :balance, AshMoney.Types.Money
|
attribute :balance, AshMoney.Types.Money
|
||||||
```
|
```
|
||||||
|
|
||||||
Or you can add it to your compile time list of types for easier reference:
|
## Add to known types
|
||||||
|
|
||||||
|
To support money operations in runtime expressions, which use `Ash`'s operator overloading feature, we have to tell Ash about the `Ash.Type.Money` using the `known_type` configuration.
|
||||||
|
|
||||||
|
```
|
||||||
|
config :ash, :known_types, [Ash.Type.Money]
|
||||||
|
```
|
||||||
|
|
||||||
|
## Referencing with `:money`
|
||||||
|
|
||||||
|
You can add it to your compile time list of types for easier reference:
|
||||||
|
|
||||||
```elixir
|
```elixir
|
||||||
config :ash, :custom_types, money: AshMoney.Types.Money
|
config :ash, :custom_types, money: AshMoney.Types.Money
|
||||||
|
|
Loading…
Reference in a new issue