我正在从 Uploadcare 迁移到 Cloudinary。
但是当我尝试更新文件字段时,该字段设置为“旧”
p = Photo _id: 556d225e69702d45b0000000, created_at: 2015-06-02 03:26:22 UTC, updated_at: 2015-06-02 03:26:22 UTC, file: nil
p.file = p.id
p.save
返回
Photo _id: 556d225e69702d45b0000000, created_at: 2015-06-02 03:26:22 UTC, updated_at: 2015-07-30 19:41:12 UTC, file: "_old_"
p.file = <PhotoUploader:0x007fe96fc86800 @model=#<Photo _id: 556d225e69702d45b0000000, created_at: 2015-06-02 03:26:22 UTC, updated_at: 2015-07-30 19:41:12 UTC, file: "_old_">, @mounted_as=:file, @stored_public_id=nil, @stored_version=nil, @file=nil, @original_filename=nil, @public_id=nil, @storage=#<Cloudinary::CarrierWave::Storage:0x007fe9701f8f18 @uploader=#<PhotoUploader:0x007fe96fc86800 ...>>>
有什么建议吗?