diff options
| author | hukl <contact@smyck.org> | 2009-09-09 12:34:19 +0200 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-09-09 12:34:19 +0200 |
| commit | 3fb1e130b9428235e73a7b530761b9cd438d7f80 (patch) | |
| tree | 5d0050e5f994701e7546b525f8ab03e89d8c7051 /app/models/node.rb | |
| parent | a6292dd0fecd4482fe863ed849d126b5281b1a8a (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/node.rb')
| -rw-r--r-- | app/models/node.rb | 1 |
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 |
