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.
This commit is contained in:
Osama Sayegh 2025-01-07 03:37:03 +03:00 committed by GitHub
parent 5202532acb
commit 7df1fac68b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -513,8 +513,10 @@ after_initialize do
# removed. Depending on the channel, uploads may end up being secure.
UploadSecurity.register_custom_public_type("chat-composer")
if Rails.env.local?
DiscoursePluginRegistry.discourse_dev_populate_reviewable_types.add DiscourseDev::ReviewableMessage
end
end
if Rails.env == "test"
Dir[Rails.root.join("plugins/chat/spec/support/**/*.rb")].each { |f| require f }