mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 13:47:58 +01:00
use the alias cache
This commit is contained in:
parent
dcc3b418c8
commit
3b18428215
2 changed files with 4 additions and 3 deletions
|
@ -63,9 +63,9 @@ defmodule Philomena.Images.Image do
|
|||
field :hides_count, :integer, default: 0
|
||||
|
||||
# todo: can probably remove these now
|
||||
# field :tag_list_cache, :string
|
||||
# field :tag_list_plus_alias_cache, :string
|
||||
# field :file_name_cache, :string
|
||||
field :tag_list_cache, :string
|
||||
field :tag_list_plus_alias_cache, :string
|
||||
field :file_name_cache, :string
|
||||
|
||||
timestamps(inserted_at: :created_at)
|
||||
end
|
||||
|
|
|
@ -48,6 +48,7 @@ defmodule PhilomenaWeb.ImageView do
|
|||
[
|
||||
image_id: image.id,
|
||||
image_tags: Jason.encode!(Enum.map(image.tags, & &1.id)),
|
||||
image_tag_aliases: image.tag_list_plus_alias_cache,
|
||||
score: image.score,
|
||||
faves: image.faves_count,
|
||||
upvotes: image.upvotes_count,
|
||||
|
|
Loading…
Reference in a new issue