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