Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorBenjamin Neff <benjamin@coding4coffee.ch>2022-07-21 04:33:08 +0300
committerBenjamin Neff <benjamin@coding4coffee.ch>2022-07-21 04:53:47 +0300
commitee68da7eebc8d01a9510328a0f64abca692f1552 (patch)
tree7801c2416d54e5a1dd3351664a05c911101e7cef /config
parent2e3bd14a09197a662f0aa9e6d406d0a1d82a0618 (diff)
Don't eager load active storage in production
We don't use active storage, but eager loading it tries to read the config/storage.yml, which doesn't exist, because we don't need it. https://github.com/rails/rails/blob/571b4d5fb9cd254db79e93370d7b208b6d0fd1e4/activestorage/lib/active_storage/engine.rb#L137 https://github.com/rails/rails/blob/571b4d5fb9cd254db79e93370d7b208b6d0fd1e4/activestorage/app/models/active_storage/blob.rb#L354 closes #8371
Diffstat (limited to 'config')
-rw-r--r--config/environments/production.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/config/environments/production.rb b/config/environments/production.rb
index f3f927a8f..ff5ec75b7 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -15,6 +15,11 @@ Rails.application.configure do
config.eager_load = true
config.eager_load_paths += %W[#{config.root}/lib]
+ # diaspora* does not use ActiveStroage. But eager loading then loads active_storage/blob.rb,
+ # which then fails if there isn't a config/storage.yml
+ # This can be removed if we ever want to use ActiveStorage and a storage.yml exists
+ config.eager_load_namespaces.delete(ActiveStorage::Engine)
+
# Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = false
config.action_controller.perform_caching = true