@@ -153,8 +153,8 module Redmine | |||
|
153 | 153 | if self.class.connection.adapter_name =~ /sqlserver/i |
|
154 | 154 | lock = "WITH (ROWLOCK HOLDLOCK UPDLOCK)" |
|
155 | 155 | end |
|
156 | sets_to_lock = [id, parent_id].compact | |
|
157 |
self.class.reorder(:id).where( |
|
|
156 | sets_to_lock = [root_id, parent.try(:root_id)].compact.uniq | |
|
157 | self.class.reorder(:id).where(:root_id => sets_to_lock).lock(lock).ids | |
|
158 | 158 | end |
|
159 | 159 | |
|
160 | 160 | def nested_set_scope |
General Comments 0
You need to be logged in to leave comments.
Login now