Don't delete asset on locked

This commit is contained in:
Jure Grabnar 2016-10-01 13:23:04 +02:00
parent a2d6d9a29a
commit 5c9e995e56

View file

@ -25,6 +25,7 @@ class Asset < ActiveRecord::Base
do_not_validate_attachment_file_type :file
before_file_post_process :allow_styles_on_images
before_destroy :check_if_locked
# Asset validation
# This could cause some problems if you create empty asset and want to
@ -452,4 +453,8 @@ class Asset < ActiveRecord::Base
self.file = data
end
def check_if_locked
return false if locked?
end
end