Skip to content

Commit

Permalink
Update lib/ecto/association.ex
Browse files Browse the repository at this point in the history
Co-authored-by: Greg Rychlewski <greg.rychlewski@gmail.com>
  • Loading branch information
tfwright and greg-rychlewski authored Jul 15, 2023
1 parent e45b73c commit f5ffef7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/ecto/association.ex
Original file line number Diff line number Diff line change
Expand Up @@ -998,9 +998,7 @@ defmodule Ecto.Association.Has do
if value = Map.get(parent, owner_key) do
query = from x in queryable, where: field(x, ^related_key) == ^value

parent
|> Ecto.get_meta(:prefix)
|> case do
case Ecto.get_meta(parent, :prefix) do
nil -> query
prefix -> Ecto.Query.put_query_prefix(query, prefix)
end
Expand Down

0 comments on commit f5ffef7

Please sign in to comment.