Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed mistake in ancestry validation regexp and removed faulty comment

  • Loading branch information...
commit ac79892def302416ccb5b089616246267598cff1 1 parent 2283294
@stefankroes stefankroes authored
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,7 +34,7 @@ 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]
@@ -42,7 +42,6 @@ def acts_as_tree options = {}
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
Please sign in to comment.
Something went wrong with that request. Please try again.