Skip to content

Commit

Permalink
use info function to get the attribute directly
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabasJ committed Dec 19, 2023
1 parent 58cb99e commit f0097ef
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/data_layer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1387,9 +1387,7 @@ defmodule AshPostgres.DataLayer do
end

defp get_source_for_upsert_field(field, resource) do
case resource
|> Ash.Resource.Info.attributes()
|> Enum.find(&(&1.name == field)) do
case Ash.Resource.Info.attribute(resource, field) do
%{source: source} when not is_nil(source) ->
source

Expand Down

0 comments on commit f0097ef

Please sign in to comment.