FIX: drop fragment cache for flags (#28001)

Flags are stored in the memory of the process and a fragment cache is not necessary.
This commit is contained in:
Krzysztof Kotlarek
2024-07-22 12:37:33 +10:00
committed by GitHub
parent 43aa47b118
commit f41716d532
3 changed files with 4 additions and 35 deletions

View File

@@ -111,17 +111,13 @@ class SiteSerializer < ApplicationSerializer
end
def post_action_types
cache_fragment("post_action_types_#{I18n.locale}") do
types = ordered_flags(PostActionType.types.values)
ActiveModel::ArraySerializer.new(types).as_json
end
types = ordered_flags(PostActionType.types.values)
ActiveModel::ArraySerializer.new(types).as_json
end
def topic_flag_types
cache_fragment("post_action_flag_types_#{I18n.locale}") do
types = ordered_flags(PostActionType.topic_flag_types.values)
ActiveModel::ArraySerializer.new(types, each_serializer: TopicFlagTypeSerializer).as_json
end
types = ordered_flags(PostActionType.topic_flag_types.values)
ActiveModel::ArraySerializer.new(types, each_serializer: TopicFlagTypeSerializer).as_json
end
def default_archetype