【发布时间】:2011-03-18 14:54:25
【问题描述】:
我在 rails 3 应用程序上使用 carrierwave 和 mongoid,并且遇到了 after_save 回调的问题。考虑以下
class Video
include Mongoid::Document
field :name
mount_uploader :file, VideoUploader
after_create :enqueue_for_encoding
protected
def enqueue_for_encoding
// point your encoding service to where it expects the permanent file to reside
// in my case on s3
end
end
我的问题是在我的enqueue_for_encoding 方法中,file.url 指向本地 tmp 目录而不是 s3 目录。
如何在 file.url 指向 s3 时调用我的 enqueue_for_encoding 方法?
谢谢!
乔纳森
【问题讨论】:
标签: ruby-on-rails mongoid carrierwave