mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-30 14:57:59 +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
|
||||
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
|
||||
galleries =
|
||||
|
@ -18,7 +18,7 @@ defmodule PhilomenaWeb.GalleryController do
|
|||
sort: parse_sort(params),
|
||||
},
|
||||
conn.assigns.pagination,
|
||||
Gallery |> preload([:thumbnail, :creator])
|
||||
Gallery |> preload([:creator, thumbnail: :tags])
|
||||
)
|
||||
|
||||
render(conn, "index.html", galleries: galleries, layout_class: "layout--wide")
|
||||
|
|
Loading…
Reference in a new issue