discourse/plugins/chat/lib/tasks/chat.rake
Roman Rizzi 0a5f548635
DEV: Move discourse-chat to the core repo. (#18776)
As part of this move, we are also renaming `discourse-chat` to `chat`.
2022-11-02 10:41:30 -03:00

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