From 3b18428215a546a59ab848e656109ba5768ea78f Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Sat, 16 Nov 2019 00:09:02 -0500 Subject: [PATCH] use the alias cache --- lib/philomena/images/image.ex | 6 +++--- lib/philomena_web/views/image_view.ex | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/philomena/images/image.ex b/lib/philomena/images/image.ex index eff0db15..285c29ad 100644 --- a/lib/philomena/images/image.ex +++ b/lib/philomena/images/image.ex @@ -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 diff --git a/lib/philomena_web/views/image_view.ex b/lib/philomena_web/views/image_view.ex index e000f087..a4b2caaa 100644 --- a/lib/philomena_web/views/image_view.ex +++ b/lib/philomena_web/views/image_view.ex @@ -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,