Skip to content
This repository
Browse code

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

… that extend past the deletion point
  • Loading branch information...
commit a1425fad91c4d8f7c92aa2a3f0c35238558a92e8 1 parent 734b88c
Joel Nimety authored June 18, 2012
2  lib/awesome_nested_set/awesome_nested_set.rb
@@ -535,7 +535,7 @@ def destroy_descendants
535 535
           in_tenacious_transaction do
536 536
             reload_nested_set
537 537
             # select the rows in the model that extend past the deletion point and apply a lock
538  
-            self.class.base_class.where(["#{quoted_left_column_name} >= ?", left]).
  538
+            nested_set_scope.where(["#{quoted_left_column_name} >= ?", left]).
539 539
                                   select(id).lock(true)
540 540
 
541 541
             if acts_as_nested_set_options[:dependent] == :destroy

0 notes on commit a1425fa

Please sign in to comment.
Something went wrong with that request. Please try again.