mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-15 06:31:44 +00:00
no ejecutar validaciones al guardar un archivo
This commit is contained in:
parent
1ae226bb3a
commit
3a38cae0bc
1 changed files with 8 additions and 6 deletions
|
@ -47,13 +47,13 @@ class MetadataFile < MetadataTemplate
|
||||||
# repetida.
|
# repetida.
|
||||||
def save
|
def save
|
||||||
value['description'] = sanitize value['description']
|
value['description'] = sanitize value['description']
|
||||||
value['path'] = nil unless path?
|
|
||||||
|
|
||||||
return true if path_optional?
|
if path?
|
||||||
return false unless hardlink
|
hardlink
|
||||||
|
value['path'] = relative_destination_path
|
||||||
# Modificar el valor actual
|
else
|
||||||
value['path'] = relative_destination_path
|
value['path'] = nil
|
||||||
|
end
|
||||||
|
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
@ -107,6 +107,8 @@ class MetadataFile < MetadataTemplate
|
||||||
end
|
end
|
||||||
|
|
||||||
def file
|
def file
|
||||||
|
return unless path?
|
||||||
|
|
||||||
@file ||=
|
@file ||=
|
||||||
case value['path']
|
case value['path']
|
||||||
when ActionDispatch::Http::UploadedFile then value['path'].tempfile.path
|
when ActionDispatch::Http::UploadedFile then value['path'].tempfile.path
|
||||||
|
|
Loading…
Reference in a new issue