From 20923682748e7a4c45f40d33974db1578a81fe3b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Gaya?= <sebastien.gaya@gmail.com>
Date: Mon, 5 Dec 2022 15:37:54 +0100
Subject: [PATCH] rename

---
 app/models/concerns/with_permalink.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/models/concerns/with_permalink.rb b/app/models/concerns/with_permalink.rb
index 37fa6d0bf..73c63fc11 100644
--- a/app/models/concerns/with_permalink.rb
+++ b/app/models/concerns/with_permalink.rb
@@ -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
-- 
GitLab