diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f540f8d84..db9a1c877 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -111,7 +111,7 @@ module ApplicationHelper end def tag_colors(tag) - Rails.cache.fetch("view-helper-#{tag}/tag_colors", expires_in: 5.hours) do + RedisRailsCache.fetch("view-helper-#{tag}/tag_colors", expires_in: 5.hours) do if (found_tag = Tag.select(%i[bg_color_hex text_color_hex]).find_by(name: tag)) { background: found_tag.bg_color_hex, color: found_tag.text_color_hex } else diff --git a/app/views/articles/show.html.erb b/app/views/articles/show.html.erb index e7a7cedb4..d8e5b5b07 100644 --- a/app/views/articles/show.html.erb +++ b/app/views/articles/show.html.erb @@ -173,7 +173,8 @@ <% cache("main-article-tags-#{@article.cached_tag_list}", expires_in: 30.hours) do %>
<% @article.cached_tag_list_array.each do |tag| %> - #<%= tag %> + <% tag_hash = tag_colors(tag) %> + #<%= tag %> <% end %>
<% end %> diff --git a/app/views/moderations/index.html.erb b/app/views/moderations/index.html.erb index 2b6b3b12c..f4424ba8c 100644 --- a/app/views/moderations/index.html.erb +++ b/app/views/moderations/index.html.erb @@ -103,7 +103,8 @@ <% cache("main-article-tags-#{article.cached_tag_list}", expires_in: 30.hours) do %>
<% article.cached_tag_list_array.each do |tag| %> - #<%= tag %> + <% tag_hash = tag_colors(tag) %> + #<%= tag %> <% end %>
<% end %>