Skip to content
Snippets Groups Projects
Unverified Commit 20923682 authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

rename

parent f9d37a16
No related branches found
No related tags found
No related merge requests found
......@@ -23,8 +23,8 @@ module WithPermalink
new_permalink = new_permalink_in_website(website)
# 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)
if new_permalink.computed_path.present? && (current_permalink.nil? || current_permalink.path != new_permalink.computed_path)
current_permalink&.update(is_current: false)
new_permalink.path = new_permalink.computed_path
new_permalink.save
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