mirror of
https://github.com/hanzoai/forum.git
synced 2026-09-30 21:51:19 +00:00
Related to https://github.com/discourse/discourse/commit/5c04d814e9f9828bbdd580e3178eb3f6b26624da The chat plugin now makes use of the plugin API that was added in the linked commit for extending the reviewables:populate rake task.
22 lines
562 B
Ruby
22 lines
562 B
Ruby
# frozen_string_literal: true
|
|
|
|
module DiscourseDev
|
|
class ReviewableMessage < Reviewable
|
|
def populate!
|
|
channel = CategoryChannel.new.create!
|
|
message = Message.new(channel_id: channel.id, count: 1).create!
|
|
user = @users.sample
|
|
|
|
::Chat::FlagMessage.call(
|
|
guardian: user.guardian,
|
|
params: {
|
|
channel_id: channel.id,
|
|
message_id: message.id,
|
|
flag_type_id:
|
|
ReviewableScore.types.slice(:off_topic, :inappropriate, :spam, :illegal).values.sample,
|
|
},
|
|
)
|
|
end
|
|
end
|
|
end
|