From 7df1fac68b53b5346712f990d3570e359e0a87c8 Mon Sep 17 00:00:00 2001 From: Osama Sayegh Date: Tue, 7 Jan 2025 03:37:03 +0300 Subject: [PATCH] DEV: Fix build (#30600) The `faker` gem, which is a dependency for the `*:populate` rake tasks, isn't installed in the production environment, so we should only load files/classes related to those rake tasks in non-production environments. --- plugins/chat/plugin.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/chat/plugin.rb b/plugins/chat/plugin.rb index cebcbaac8f7..07c61261ecb 100644 --- a/plugins/chat/plugin.rb +++ b/plugins/chat/plugin.rb @@ -513,7 +513,9 @@ after_initialize do # removed. Depending on the channel, uploads may end up being secure. UploadSecurity.register_custom_public_type("chat-composer") - DiscoursePluginRegistry.discourse_dev_populate_reviewable_types.add DiscourseDev::ReviewableMessage + if Rails.env.local? + DiscoursePluginRegistry.discourse_dev_populate_reviewable_types.add DiscourseDev::ReviewableMessage + end end if Rails.env == "test"