mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-24 04:27:59 +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
|
field :hides_count, :integer, default: 0
|
||||||
|
|
||||||
# todo: can probably remove these now
|
# todo: can probably remove these now
|
||||||
# field :tag_list_cache, :string
|
field :tag_list_cache, :string
|
||||||
# field :tag_list_plus_alias_cache, :string
|
field :tag_list_plus_alias_cache, :string
|
||||||
# field :file_name_cache, :string
|
field :file_name_cache, :string
|
||||||
|
|
||||||
timestamps(inserted_at: :created_at)
|
timestamps(inserted_at: :created_at)
|
||||||
end
|
end
|
||||||
|
|
|
@ -48,6 +48,7 @@ defmodule PhilomenaWeb.ImageView do
|
||||||
[
|
[
|
||||||
image_id: image.id,
|
image_id: image.id,
|
||||||
image_tags: Jason.encode!(Enum.map(image.tags, & &1.id)),
|
image_tags: Jason.encode!(Enum.map(image.tags, & &1.id)),
|
||||||
|
image_tag_aliases: image.tag_list_plus_alias_cache,
|
||||||
score: image.score,
|
score: image.score,
|
||||||
faves: image.faves_count,
|
faves: image.faves_count,
|
||||||
upvotes: image.upvotes_count,
|
upvotes: image.upvotes_count,
|
||||||
|
|
Loading…
Reference in a new issue