Browse files

Fixed mistake in ancestry validation regexp and removed faulty comment

  • Loading branch information...
1 parent 2283294 commit ac79892def302416ccb5b089616246267598cff1 @stefankroes committed Oct 29, 2009
Showing with 1 addition and 2 deletions.
  1. +1 −2 lib/ancestry/acts_as_tree.rb
View
3 lib/ancestry/acts_as_tree.rb
@@ -34,15 +34,14 @@ def acts_as_tree options = {}
self.orphan_strategy = options[:orphan_strategy] || :destroy
# Validate format of ancestry column value
- validates_format_of ancestry_column, :with => /^[0-9]+(\/[0-9]+)*$/, :allow_nil => true
+ validates_format_of ancestry_column, :with => /\A[0-9]+(\/[0-9]+)*\Z/, :allow_nil => true
# Create ancestry column accessor and set to option or default
if options[:cache_depth]
self.cattr_accessor :depth_cache_column
self.depth_cache_column = options[:depth_cache_column] || :ancestry_depth
# Cache depth in depth cache column before save
before_save :cache_depth
- # Named scopes for depth
end
# Create named scopes for depth

0 comments on commit ac79892

Please sign in to comment.