Skip to content

Commit

Permalink
use proper dependent preloads (#451)
Browse files Browse the repository at this point in the history
  • Loading branch information
PragTob authored Nov 10, 2024
1 parent 9e957d9 commit ca9cf8e
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions lib/mindwendel/lanes.ex
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,7 @@ defmodule Mindwendel.Lanes do

lane_query
|> Repo.all()
|> Repo.preload(
ideas:
ideas_advanced_query
|> preload([
:link,
:likes,
:idea_labels,
:files
])
)
|> Repo.preload(ideas: {ideas_advanced_query, [:link, :likes, :idea_labels, :files]})
end

defp build_ideas_query_with_filter(%{filter_labels_ids: filter_labels_ids}) do
Expand All @@ -128,7 +119,7 @@ defmodule Mindwendel.Lanes do
end

defp build_ideas_query_with_filter(%{} = _filters) do
Idea
from(idea in Idea)
end

@doc """
Expand Down

0 comments on commit ca9cf8e

Please sign in to comment.