Permalink
Browse files

Fixed .restore_ancestry_integrity! method, model.exists?(args) does n…

…ot exist anymore in mongoid 3
  • Loading branch information...
1 parent 896c44a commit c5fbaeabfe29e8de6da355308ba49ba538127ae1 @jbbarth committed May 30, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/mongoid-ancestry/class_methods.rb
View
2 lib/mongoid-ancestry/class_methods.rb
@@ -167,7 +167,7 @@ def restore_ancestry_integrity!
end
end
# ... save parent of this node in parents array if it exists
- parents[node.id] = node.parent_id if exists? node.parent_id
+ parents[node.id] = node.parent_id if where(:_id => node.parent_id).first
# Reset parent id in array to nil if it introduces a cycle
parent = parents[node.id]

0 comments on commit c5fbaea

Please sign in to comment.