5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-16 16:01:41 +00:00

conseguir la ruta al archivo

This commit is contained in:
f 2022-03-04 19:19:40 -03:00
parent 63f8b869eb
commit 37deb36178

View file

@ -83,6 +83,15 @@ class MetadataFile < MetadataTemplate
end
end
# Obtiene la ruta absoluta al archivo
#
# @return [Pathname]
def pathname
raise NoMethodError unless uploaded?
@pathname ||= Pathname.new(File.join(site.path, value['path']))
end
def key_from_path
path.dirname.basename.to_s
end