Project

General

Profile

Patch #28939 » nested_set.patch

Pavel Rosický, 2018-06-04 00:49

View differences:

issue_nested_set.rb (working copy)
149 149
      end
150 150

  
151 151
      def lock_nested_set
152
        if self.class.connection.adapter_name =~ /sqlserver/i
152
        if self.class.connection.adapter_name.casecmp('sqlserver') == 0
153 153
          lock = "WITH (ROWLOCK HOLDLOCK UPDLOCK)"
154 154
          # Custom lock for SQLServer
155 155
          # This can be problematic if root_id or parent root_id changes
project_nested_set.rb (working copy)
119 119

  
120 120
      def lock_nested_set
121 121
        lock = true
122
        if self.class.connection.adapter_name =~ /sqlserver/i
122
        if self.class.connection.adapter_name.casecmp('sqlserver') == 0
123 123
          lock = "WITH (ROWLOCK HOLDLOCK UPDLOCK)"
124 124
        end
125 125
        self.class.order(:id).lock(lock).ids
(2-2/2)