Permalink
Browse files

use nested_set_scope when selecting and locking the rows in the model…

… that extend past the deletion point
  • Loading branch information...
1 parent 734b88c commit a1425fad91c4d8f7c92aa2a3f0c35238558a92e8 @jnimety jnimety committed Jun 18, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/awesome_nested_set/awesome_nested_set.rb
@@ -535,7 +535,7 @@ def destroy_descendants
in_tenacious_transaction do
reload_nested_set
# select the rows in the model that extend past the deletion point and apply a lock
- self.class.base_class.where(["#{quoted_left_column_name} >= ?", left]).
+ nested_set_scope.where(["#{quoted_left_column_name} >= ?", left]).
select(id).lock(true)
if acts_as_nested_set_options[:dependent] == :destroy

0 comments on commit a1425fa

Please sign in to comment.