Skip to content

Commit

Permalink
Merge pull request #66 from roomthirteen/feature_skip_resource_deletion
Browse files Browse the repository at this point in the history
Implemented configuration option to skip deletion of the cloudinary resource on destory
  • Loading branch information
assembler committed Aug 13, 2013
2 parents 3a2f2aa + 2cd2085 commit 3a56e9d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/attachinary/orm/file_mixin.rb
Expand Up @@ -27,6 +27,11 @@ def fullpath(options={})

private
def destroy_file
metadata = attachinariable.send "#{self.scope}_metadata"
if metadata.has_key?(:delete_resource_on_destroy) && metadata[:delete_resource_on_destroy] == false
# do not delete the resource on cloudinary
return
end
Cloudinary::Uploader.destroy(public_id) if public_id
end

Expand Down

0 comments on commit 3a56e9d

Please sign in to comment.