Skip to content
Snippets Groups Projects
Commit a3e6216d authored by Arnaud Levy's avatar Arnaud Levy
Browse files

better

parent f9d37a16
No related branches found
No related tags found
No related merge requests found
......@@ -24,9 +24,8 @@ module WithPermalink
# If the object had no permalink or if its path changed, we create a new permalink
if new_permalink.computed_path.present? && (last_permalink.nil? || last_permalink.path != new_permalink.computed_path)
last_permalink&.update(is_current: false)
new_permalink.path = new_permalink.computed_path
new_permalink.save
last_permalink&.update(is_current: false) if new_permalink.save
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment