summaryrefslogtreecommitdiff
path: root/app/models/node.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/node.rb')
-rw-r--r--app/models/node.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/models/node.rb b/app/models/node.rb
index 6ca607d..717f5b4 100644
--- a/app/models/node.rb
+++ b/app/models/node.rb
@@ -268,9 +268,12 @@ class Node < ApplicationRecord
268 parent.nil? ? [slug] : parent.path_to_root.push(slug) 268 parent.nil? ? [slug] : parent.path_to_root.push(slug)
269 end 269 end
270 270
271 def computed_unique_name
272 path = path_to_root[1..-1].join("/") # excluding root
273 end
274
271 def current_unique_name 275 def current_unique_name
272 path = path_to_root[1..-1] # excluding root 276 self.unique_name = computed_unique_name
273 self.unique_name = path.join("/")
274 end 277 end
275 278
276 def update_unique_name 279 def update_unique_name