diff --git a/lib/data_layer.ex b/lib/data_layer.ex index d0df9ac..76ad509 100644 --- a/lib/data_layer.ex +++ b/lib/data_layer.ex @@ -1238,8 +1238,6 @@ defmodule AshPostgres.DataLayer do @known_inner_join_predicates @known_inner_join_functions ++ @known_inner_join_operators - # For consistency's sake, this logic was removed. - # We can revisit it sometime though. defp can_inner_join?(path, expr, seen_an_or? \\ false) defp can_inner_join?(path, %{expression: expr}, seen_an_or?), diff --git a/mix.exs b/mix.exs index e097219..82bf52a 100644 --- a/mix.exs +++ b/mix.exs @@ -95,7 +95,7 @@ defmodule AshPostgres.MixProject do {:ecto_sql, "~> 3.5"}, {:jason, "~> 1.0"}, {:postgrex, ">= 0.0.0"}, - {:ash, ash_version("~> 1.46 and >= 1.46.11")}, + {:ash, ash_version("~> 1.46 and >= 1.46.13")}, {:git_ops, "~> 2.4.3", only: :dev}, {:ex_doc, "~> 0.22", only: :dev, runtime: false}, {:ex_check, "~> 0.11.0", only: :dev}, diff --git a/mix.lock b/mix.lock index 920307c..a63e8da 100644 --- a/mix.lock +++ b/mix.lock @@ -1,5 +1,5 @@ %{ - "ash": {:hex, :ash, "1.46.11", "bc404875dad27ed5a9e4fc2ad5369287342da1eeb571ec1b85b21c024515b9f7", [:mix], [{:comparable, "~> 1.0", [hex: :comparable, repo: "hexpm", optional: false]}, {:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:ecto, "~> 3.4", [hex: :ecto, repo: "hexpm", optional: false]}, {:ets, "~> 0.8.0", [hex: :ets, repo: "hexpm", optional: false]}, {:jason, ">= 1.0.0", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.3.5", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:picosat_elixir, "~> 0.1.5", [hex: :picosat_elixir, repo: "hexpm", optional: false]}, {:timex, ">= 3.0.0", [hex: :timex, repo: "hexpm", optional: false]}], "hexpm", "685814bb094dbc2cc4c9dd460778670f6d248c006fcd02e8a75fe173350bb0b1"}, + "ash": {:hex, :ash, "1.46.13", "a35031db1be028d871f1a381901643f1cbdc2e52aaf6752ad9893af45dcdbd3e", [:mix], [{:comparable, "~> 1.0", [hex: :comparable, repo: "hexpm", optional: false]}, {:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:ecto, "~> 3.4", [hex: :ecto, repo: "hexpm", optional: false]}, {:ets, "~> 0.8.0", [hex: :ets, repo: "hexpm", optional: false]}, {:jason, ">= 1.0.0", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.3.5", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:picosat_elixir, "~> 0.1.5", [hex: :picosat_elixir, repo: "hexpm", optional: false]}, {:timex, ">= 3.0.0", [hex: :timex, repo: "hexpm", optional: false]}], "hexpm", "776a44f14c874a7bdf668540c02b80d1232d5e92dca469474a9b7fc606fea3d9"}, "bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"}, "certifi": {:hex, :certifi, "2.6.1", "dbab8e5e155a0763eea978c913ca280a6b544bfa115633fa20249c3d396d9493", [:rebar3], [], "hexpm", "524c97b4991b3849dd5c17a631223896272c6b0af446778ba4675a1dff53bb7e"}, "combine": {:hex, :combine, "0.10.0", "eff8224eeb56498a2af13011d142c5e7997a80c8f5b97c499f84c841032e429f", [:mix], [], "hexpm", "1b1dbc1790073076580d0d1d64e42eae2366583e7aecd455d1215b0d16f2451b"}, diff --git a/test/sort_test.exs b/test/sort_test.exs index d715968..d9efa3e 100644 --- a/test/sort_test.exs +++ b/test/sort_test.exs @@ -103,4 +103,11 @@ defmodule AshPostgres.SortTest do |> Ash.Query.select([:title, :score]) ) end + + test "calculations can be sorted on w/o loading aggregates they reference" do + Post + |> Ash.Query.load(:count_of_comments) + |> Ash.Query.sort(:c_times_p) + |> Api.read!() + end end