Files
discourse-solved/app/lib/plugin_initializers/assigned_reminder_exclude_solved.rb
T
Lhc_fl 150f7f4a35 DEV: Move the post and topic custom fields into a table
This PR does some preparatory work to prepare for the front-end display
of who marked an answer as solved. It migrates the custom fields from
discourse-solved of Topic and Post to a new table, except "accepted_answer_post_id"

ref: /t/-/95318
2024-09-05 17:55:02 +08:00

26 lines
634 B
Ruby

# frozen_string_literal: true
module DiscourseSolved
class PluginInitializer
attr_reader :plugin
def initialize(plugin)
@plugin = plugin
end
def apply_plugin_api
# this method should be overridden by subclasses
raise NotImplementedError
end
end
class AssignsReminderForTopicsQuery < PluginInitializer
def apply_plugin_api
plugin.register_modifier(:assigns_reminder_assigned_topics_query) do |query|
next query if !SiteSetting.ignore_solved_topics_in_assigned_reminder
query.where.not(id: DiscourseSolved::Solution.pluck(:topic_id))
end
end
end
end