mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-29 11:45:18 +08:00
Don't delete asset on locked
This commit is contained in:
parent
a2d6d9a29a
commit
5c9e995e56
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue