summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-09-10 12:00:03 +0200
committerhukl <contact@smyck.org>2009-09-10 12:00:03 +0200
commit8afffc09bcaa4d1c77f1ca575fd5978423631bff (patch)
treecc9c4d8d402337903584d845f5f2df6afdc52ba1 /app/models
parentf7ce8c245fde3f6202103ae614b181c0ba44ed93 (diff)
refactored the create method to actually produce meaningful error messages when something goes wrong. added tests for corner cases
Diffstat (limited to 'app/models')
-rw-r--r--app/models/node.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/node.rb b/app/models/node.rb
index 057248e..fa9d519 100644
--- a/app/models/node.rb
+++ b/app/models/node.rb
@@ -16,7 +16,8 @@ class Node < ActiveRecord::Base
16 after_save :update_unique_names_of_children 16 after_save :update_unique_names_of_children
17 17
18 # Validations 18 # Validations
19 # validates_length_of :slug, :within => 3..40 19 validates_length_of :slug, :within => 1..255
20 validates_presence_of :slug
20 validates_uniqueness_of :slug, :scope => :parent_id 21 validates_uniqueness_of :slug, :scope => :parent_id
21 22
22 # Index for Fulltext Search 23 # Index for Fulltext Search