arreglos a la subida de archivos
This commit is contained in:
parent
c050d861bf
commit
1ae226bb3a
2 changed files with 9 additions and 1 deletions
|
@ -123,10 +123,18 @@ class MetadataFile < MetadataTemplate
|
|||
#
|
||||
# @return [Boolean]
|
||||
def hardlink
|
||||
return true if hardlink?
|
||||
|
||||
FileUtils.mkdir_p(File.dirname(destination_path))
|
||||
FileUtils.ln(uploaded_path, destination_path).zero?
|
||||
end
|
||||
|
||||
def hardlink?
|
||||
File.stat(uploaded_path).ino == File.stat(destination_path).ino
|
||||
rescue Errno::ENOENT
|
||||
false
|
||||
end
|
||||
|
||||
# Obtener la ruta al archivo
|
||||
# https://stackoverflow.com/a/53908358
|
||||
def uploaded_relative_path
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
.form-group
|
||||
- if metadata.uploaded?
|
||||
- if metadata.static_file
|
||||
= hidden_field_tag "#{base}[#{attribute}][path]", metadata.value['path']
|
||||
|
||||
- case metadata.static_file.blob.content_type
|
||||
|
|
Loading…
Reference in a new issue