Skip to content

Commit

Permalink
Fixed mistake in ancestry validation regexp and removed faulty comment
Browse files Browse the repository at this point in the history
  • Loading branch information
stefankroes committed Oct 29, 2009
1 parent 2283294 commit ac79892
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/ancestry/acts_as_tree.rb
Expand Up @@ -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
Expand Down

0 comments on commit ac79892

Please sign in to comment.