summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-09-09 12:34:19 +0200
committerhukl <contact@smyck.org>2009-09-09 12:34:19 +0200
commit3fb1e130b9428235e73a7b530761b9cd438d7f80 (patch)
tree5d0050e5f994701e7546b525f8ab03e89d8c7051 /app/models
parenta6292dd0fecd4482fe863ed849d126b5281b1a8a (diff)
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?
Diffstat (limited to 'app/models')
-rw-r--r--app/models/node.rb1
1 files changed, 1 insertions, 0 deletions
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
16 16
17 # Validations 17 # Validations
18 # validates_length_of :slug, :within => 3..40 18 # validates_length_of :slug, :within => 3..40
19 validates_uniqueness_of :slug, :scope => :parent_id
19 20
20 # Index for Fulltext Search 21 # Index for Fulltext Search
21 define_index do 22 define_index do