mirror of
https://github.com/discourse/discourse.git
synced 2024-12-04 15:03:52 +08:00
0a5f548635
As part of this move, we are also renaming `discourse-chat` to `chat`.
24 lines
806 B
Ruby
24 lines
806 B
Ruby
# frozen_string_literal: true
|
|
|
|
if Discourse.allow_dev_populate?
|
|
chat_task = Rake::Task["dev:populate"]
|
|
chat_task.enhance do
|
|
SiteSetting.chat_enabled = true
|
|
DiscourseDev::PublicChannel.populate!
|
|
DiscourseDev::DirectChannel.populate!
|
|
DiscourseDev::Message.populate!
|
|
end
|
|
|
|
desc "Generates sample content for chat"
|
|
task "chat:populate" => ["db:load_config"] do |_, args|
|
|
DiscourseDev::PublicChannel.new.populate!(ignore_current_count: true)
|
|
DiscourseDev::DirectChannel.new.populate!(ignore_current_count: true)
|
|
DiscourseDev::Message.new.populate!(ignore_current_count: true)
|
|
end
|
|
|
|
desc "Generates sample messages in channels"
|
|
task "chat:message:populate" => ["db:load_config"] do |_, args|
|
|
DiscourseDev::Message.new.populate!(ignore_current_count: true)
|
|
end
|
|
end
|