discourse/plugins/discourse-solved/lib/discourse_solved/accepted_answer_cache.rb
Jarek Radosz e372355fd0
DEV: Clean up scope resolution operators in plugins (#34979)
Co-authored-by: Loïc Guitaut <loic@discourse.org>
2025-09-30 14:36:34 +02:00

22 lines
543 B
Ruby

# frozen_string_literal: true
module DiscourseSolved
class AcceptedAnswerCache
@@allowed_accepted_cache = DistributedCache.new("allowed_accepted")
def self.reset_accepted_answer_cache
@@allowed_accepted_cache["allowed"] = begin
Set.new(
CategoryCustomField.where(
name: DiscourseSolved::ENABLE_ACCEPTED_ANSWERS_CUSTOM_FIELD,
value: "true",
).pluck(:category_id),
)
end
end
def self.allowed
@@allowed_accepted_cache["allowed"]
end
end
end