mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-02-25 14:34:33 +01:00
preload tags of thumbnail
This commit is contained in:
parent
1ad4f8f076
commit
809da3c73f
1 changed files with 2 additions and 2 deletions
|
@ -4,7 +4,7 @@ defmodule PhilomenaWeb.GalleryController do
|
||||||
alias Philomena.Galleries.Gallery
|
alias Philomena.Galleries.Gallery
|
||||||
import Ecto.Query
|
import Ecto.Query
|
||||||
|
|
||||||
plug :load_resource, model: Gallery, preload: [:thumbnail, :creator]
|
plug :load_resource, model: Gallery, preload: [:creator, thumbnail: :tags]
|
||||||
|
|
||||||
def index(conn, params) do
|
def index(conn, params) do
|
||||||
galleries =
|
galleries =
|
||||||
|
@ -18,7 +18,7 @@ defmodule PhilomenaWeb.GalleryController do
|
||||||
sort: parse_sort(params),
|
sort: parse_sort(params),
|
||||||
},
|
},
|
||||||
conn.assigns.pagination,
|
conn.assigns.pagination,
|
||||||
Gallery |> preload([:thumbnail, :creator])
|
Gallery |> preload([:creator, thumbnail: :tags])
|
||||||
)
|
)
|
||||||
|
|
||||||
render(conn, "index.html", galleries: galleries, layout_class: "layout--wide")
|
render(conn, "index.html", galleries: galleries, layout_class: "layout--wide")
|
||||||
|
|
Loading…
Reference in a new issue