Commit 1bbdc0dd by LI Daobing

delete works

parent c8e41f90
......@@ -54,11 +54,8 @@ module Paperclip
AWS_BUCKET_SUBDOMAIN_RESTRICTON_REGEX = /^(?:[a-z]|\d(?!\d{0,2}(?:\.\d{1,3}){3}$))(?:[a-z0-9]|\.(?![\.\-])|\-(?![\.])){1,61}[a-z0-9]$/
def exists?(style = default_style)
if original_filename
!!directory.files.head(path(style))
else
false
end
init
!!::Qiniu::RS.stat(bucket, path(style))
end
def fog_credentials
......@@ -92,9 +89,9 @@ module Paperclip
end
def flush_deletes
init
for path in @queued_for_delete do
log("deleting #{path}")
directory.files.new(:key => path).destroy
::Qiniu::RS.delete(bucket, path)
end
@queued_for_delete = []
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment