Files
grecia/config/initializers/disable_active_storage_uploads.rb
Javi Martín e8195c201d Avoid warnings during initialization
These warnings appear in the logs in the development environment, and,
with Rails 7, the application will crash. When running the tests, they
would appear in the standard error ouput if we set `config.cache_classes
= false` in the test environment but, since that isn't the case, they
don't.

To reproduce these warnings (or the lack of them), start a Rails console
in development and check the log/development.log file.
2024-04-11 19:08:02 +02:00

14 lines
255 B
Ruby

Rails.application.reloader.to_prepare do
ActiveStorage::DirectUploadsController.class_eval do
def create
head :unauthorized
end
end
ActiveStorage::DiskController.class_eval do
def update
head :unauthorized
end
end
end