From 3fb1e130b9428235e73a7b530761b9cd438d7f80 Mon Sep 17 00:00:00 2001 From: hukl Date: Wed, 9 Sep 2009 12:34:19 +0200 Subject: uhm yeah - well it was finally time to validate the uniqueness of slugs scoped to the parent_id. Who though it wasn't there already? --- app/models/node.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'app/models/node.rb') diff --git a/app/models/node.rb b/app/models/node.rb index d4979ea..4bc8ed4 100644 --- a/app/models/node.rb +++ b/app/models/node.rb @@ -16,6 +16,7 @@ class Node < ActiveRecord::Base # Validations # validates_length_of :slug, :within => 3..40 + validates_uniqueness_of :slug, :scope => :parent_id # Index for Fulltext Search define_index do -- cgit v1.3