Skip to content

Commit

Permalink
use nested_set_scope when selecting and locking the rows in the model…
Browse files Browse the repository at this point in the history
… that extend past the deletion point
  • Loading branch information
Joel Nimety committed Jun 18, 2012
1 parent 734b88c commit a1425fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/awesome_nested_set/awesome_nested_set.rb
Expand Up @@ -535,7 +535,7 @@ def destroy_descendants
in_tenacious_transaction do in_tenacious_transaction do
reload_nested_set reload_nested_set
# select the rows in the model that extend past the deletion point and apply a lock # 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) select(id).lock(true)


if acts_as_nested_set_options[:dependent] == :destroy if acts_as_nested_set_options[:dependent] == :destroy
Expand Down

0 comments on commit a1425fa

Please sign in to comment.