mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 17:36:22 +00:00
fix: actualizar el hash solo cuando se escribir cambios
y devolver el resultado de Site::Writer#save
This commit is contained in:
parent
74af751264
commit
59bbc04230
1 changed files with 4 additions and 4 deletions
|
@ -33,10 +33,10 @@ class Site
|
|||
def write
|
||||
return if persisted?
|
||||
|
||||
@saved = Site::Writer.new(site: site, file: path,
|
||||
content: content.to_yaml).save
|
||||
# Actualizar el hash para no escribir dos veces
|
||||
@hash = content.hash
|
||||
@saved = Site::Writer.new(site: site, file: path, content: content.to_yaml).save.tap do |result|
|
||||
# Actualizar el hash para no escribir dos veces
|
||||
@hash = content.hash
|
||||
end
|
||||
end
|
||||
alias save write
|
||||
|
||||
|
|
Loading…
Reference in a new issue