【发布时间】:2019-12-18 10:40:46
【问题描述】:
我正在将我的 rails 5.2 升级到 rails 6。以下是我的旧代码,其中
object_path我得到/tmp/image_processing20191218-32740-qqg8h3.jpg
def load_image_path(key)
if %w[development test].include? Rails.env
path = ActiveStorage::Blob.service.send(:path_for, key)
object_path = ImageProcessing::MiniMagick.source(path).call.to_path
else
object = S3.new.bucket.object key
object_path = object.presigned_url(:get)
end
object_path
end
现在,随着图像魔法从活动存储中删除,
ImageProcessing::MiniMagick.source(path).call.to_path不起作用。有谁知道替代方案?在将 blob 存储在数据库中之前,我需要此路径
【问题讨论】:
标签: image-processing rails-activestorage ruby-on-rails-6