1 Rails.application.config.active_storage.queue = :storage
2 Rails.application.config.active_storage.variable_content_types << "image/bmp"
4 Rails.configuration.after_initialize do
5 require "active_storage/service/s3_service"
6 require_dependency "active_storage/variant"
14 File.open(image.path, "r") { |file| service.upload(key, file, :content_type => content_type) }
19 def upload(key, io, content_type:, **options)
20 @upload_options[:content_type] = content_type
21 super(key, io, **options)
22 @upload_options.delete(:content_type)
28 ActiveStorage::Variant.prepend(OpenStreetMap::ActiveStorage::Variant)
29 ActiveStorage::Service::S3Service.prepend(OpenStreetMap::ActiveStorage::S3Service)
31 ActiveSupport::Reloader.to_complete do
32 ActiveStorage::Variant.prepend(OpenStreetMap::ActiveStorage::Variant)