diff --git a/lib/awesome_nested_set/awesome_nested_set.rb b/lib/awesome_nested_set/awesome_nested_set.rb index e33dbc0f..519034c0 100644 --- a/lib/awesome_nested_set/awesome_nested_set.rb +++ b/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