mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 15:52:12 +08:00
b380ed5282
This is a feature that used to be present in discourse-assign but is much easier to implement in core. It also allows a topic to be assigned without it claiming for review and vice versa and allows it to work with category group reviewers.
15 lines
359 B
Ruby
15 lines
359 B
Ruby
class ReviewableClaimedTopic < ActiveRecord::Base
|
|
belongs_to :topic
|
|
belongs_to :user
|
|
|
|
def self.claimed_hash(topic_ids)
|
|
result = {}
|
|
if SiteSetting.reviewable_claiming != 'disabled'
|
|
ReviewableClaimedTopic.where(topic_id: topic_ids).includes(:user).each do |rct|
|
|
result[rct.topic_id] = rct.user
|
|
end
|
|
end
|
|
result
|
|
end
|
|
end
|