lib/carrierwave/storage/aliyun_file.rb in carrierwave-aliyun-1.0.0 vs lib/carrierwave/storage/aliyun_file.rb in carrierwave-aliyun-1.1.0
- old
+ new
@@ -45,11 +45,15 @@
def content_type=(new_content_type)
headers[:content_type] = new_content_type
end
- def store(file, headers = {})
- bucket.put(@path, file, headers)
+ def store(new_file, headers = {})
+ if new_file.is_a?(self.class)
+ new_file.move_to(path)
+ else
+ bucket.put(@path, new_file, headers)
+ end
end
def headers
@headers ||= {}
end