From 102522adf7f8905c60042a65db62e7b3a23b0500 Mon Sep 17 00:00:00 2001 From: Zach Daniel Date: Mon, 3 Jul 2023 22:44:11 -0400 Subject: [PATCH 1/2] fix: select attributes in load statement --- lib/ash/actions/read.ex | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/ash/actions/read.ex b/lib/ash/actions/read.ex index 32ca4b0c6..48a2e201e 100644 --- a/lib/ash/actions/read.ex +++ b/lib/ash/actions/read.ex @@ -1431,10 +1431,15 @@ defmodule Ash.Actions.Read do end) |> Enum.reduce(loaded, fn key, query when is_atom(key) -> - if relationship = Ash.Resource.Info.relationship(query.resource, key) do - Ash.Query.ensure_selected(query, relationship.source_attribute) - else - query + cond do + relationship = Ash.Resource.Info.relationship(query.resource, key) -> + Ash.Query.ensure_selected(query, relationship.source_attribute) + + Ash.Resource.Info.attribute(query.resource, key) -> + Ash.Query.ensure_selected(query, key) + + true -> + query end _, query -> From 8be33c54869ba9583005e053ee59192a05ec44a8 Mon Sep 17 00:00:00 2001 From: Zach Daniel Date: Mon, 3 Jul 2023 22:45:38 -0400 Subject: [PATCH 2/2] chore: release version v2.11.1 --- CHANGELOG.md | 9 +++++++++ README.md | 2 +- documentation/tutorials/get-started.md | 2 +- mix.exs | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3642158d..45f5ce37a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,15 @@ See [Conventional Commits](Https://conventionalcommits.org) for commit guideline +## [v2.11.1](https://github.com/ash-project/ash/compare/v2.11.0...v2.11.1) (2023-07-04) + + + + +### Bug Fixes: + +* select attributes in load statement + ## [v2.11.0](https://github.com/ash-project/ash/compare/v2.11.0-rc.3...v2.11.0) (2023-07-04) diff --git a/README.md b/README.md index e7fc35438..2bfc5679d 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ ```elixir def deps do [ - {:ash, "~> 2.11.0"} + {:ash, "~> 2.11.1"} ] end ``` diff --git a/documentation/tutorials/get-started.md b/documentation/tutorials/get-started.md index f87cdd2aa..aaf5f56a1 100644 --- a/documentation/tutorials/get-started.md +++ b/documentation/tutorials/get-started.md @@ -73,7 +73,7 @@ defp deps do [ # {:dep_from_hexpm, "~> 0.3.0"}, # {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"}, - {:ash, "~> 2.11.0"} # <-- add this line + {:ash, "~> 2.11.1"} # <-- add this line ] end ``` diff --git a/mix.exs b/mix.exs index 52d4dc200..5a7cb05e3 100644 --- a/mix.exs +++ b/mix.exs @@ -7,7 +7,7 @@ defmodule Ash.MixProject do designed to be used by multiple front ends. """ - @version "2.11.0" + @version "2.11.1" def project do [