diff --git a/lib/mongoid_acts_as_tree.rb b/lib/mongoid_acts_as_tree.rb index ffc3477..ee455d5 100644 --- a/lib/mongoid_acts_as_tree.rb +++ b/lib/mongoid_acts_as_tree.rb @@ -222,7 +222,7 @@ def build(attributes) #To delete object use object.destroy. def delete(object_or_id) object = case object_or_id - when String, BSON::ObjectID + when String, BSON::ObjectId @parent.class.find object_or_id else object_or_id