diff --git a/CHANGELOG.md b/CHANGELOG.md index 1733b6cd..ae276cf1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,16 +28,18 @@ See [Conventional Commits](Https://conventionalcommits.org) for commit guideline * the semantics of `forbid_unless` were not wrong ## [v2.0.0-rc.1](https://github.com/ash-project/ash/compare/v2.0.0-rc.0...v2.0.0-rc.1) (2022-09-04) - - - - ### Bug Fixes: * `forbid_unless` expression compilation * fix runtime filter join simulation for multiple rows +## [v2.0.0-rc.0](https://github.com/ash-project/ash/compare/v1.53.3...v2.0.0-rc.0) (2022-09-04) + +### Bug Fixes: + +* Initial Ash 2.0.0-rc.0 release! + ## [v1.53.3](https://github.com/ash-project/ash/compare/v1.53.2...v1.53.3) (2022-08-22) diff --git a/documentation/how_to/upgrade.md b/documentation/how_to/upgrade.md index fc3a235a..e5e5dd04 100644 --- a/documentation/how_to/upgrade.md +++ b/documentation/how_to/upgrade.md @@ -18,6 +18,7 @@ These should all be straight forward enough to do a simple find and replace in y - `source_field_on_join_table` -> `source_attribute_on_join_resource` - `destination_field_on_join_table` -> `destination_attribute_on_join_resource` - `no_fields?` -> `no_attributes?` +- `expensive?` -> `before_action?` (on validations) ### DSL changes diff --git a/documentation/topics/expressions.md b/documentation/topics/expressions.md index 74df08ad..58ddb2ef 100644 --- a/documentation/topics/expressions.md +++ b/documentation/topics/expressions.md @@ -40,6 +40,7 @@ The following functions are built in: - `get_path` | i.e `get_path(value, ["foo", "bar"])`. This is what expressions like `value[:foo]["bar"]` are turned into under the hood. - `ago` | i.e `deleted_at > ago(7, :day)`. The available time intervals are documented in {{link:ash:module:Ash.Type.DurationName}} - `contains` | if one string contains another string, i.e `contains("fred", "red")` +- `exists` | `exists(foo.bar, name == "fred")` takes an expression scoped to the destination, and ## Primitives @@ -48,16 +49,16 @@ The following functions are built in: ## Templates -Most of the time, when you are using an expression, you will actually be creating a `template`. In this template, you have a few references that can be used, which will be replaced when before the expression is evaluated. The following references are available: +Most of the time, when you are using an expression, you will actually be creating a `template`. In this template, you have a few references that can be used, which will be replaced when before the expression is evaluated. The following references are available. The ones that start with `^` must be imported from `Ash.Filter.TemplateHelpers`. ```elixir -actor(:key) # equivalent to `get_in(actor || %{}, [:key])` -actor([:key1, :key2]) # equivalent to `get_in(actor || %{}, [:key, :key2])` -arg(:arg_name) # equivalent to `Map.get(arguments, :arg_name)` +^actor(:key) # equivalent to `get_in(actor || %{}, [:key])` +^actor([:key1, :key2]) # equivalent to `get_in(actor || %{}, [:key, :key2])` +^arg(:arg_name) # equivalent to `Map.get(arguments, :arg_name)` +^context(:key) # equivalent to `get_in(context, :key)` +^context([:key1, :key2]) # equivalent to `get_in(context, [:key1, :key2])` ref(:key) # equivalent to referring to `key`. Allows for dynamic references ref(:key, [:path]) # equivalent to referring to `path.key`. Allows for dynamic references with dynamic (or static) paths. -context(:key) # equivalent to `get_in(context, :key)` -context([:key1, :key2]) # equivalent to `get_in(context, [:key1, :key2])` ``` ## Use cases for expressions