1 Rails.configuration.after_initialize do
2 require "active_storage/service/s3_service"
3 require_dependency "active_storage/variant"
11 File.open(image.path, "r") { |file| service.upload(key, file, :content_type => content_type) }
16 def upload(key, io, content_type:, **options)
17 @upload_options[:content_type] = content_type
18 super(key, io, **options)
19 @upload_options.delete(:content_type)
25 ActiveStorage::Variant.prepend(OpenStreetMap::ActiveStorage::Variant)
26 ActiveStorage::Service::S3Service.prepend(OpenStreetMap::ActiveStorage::S3Service)
28 ActiveSupport::Reloader.to_complete do
29 ActiveStorage::Variant.prepend(OpenStreetMap::ActiveStorage::Variant)