summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-12-01 17:17:04 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-12-01 17:17:04 +0800
commit7839aa55f57e5eb22141ed068cf43a29aac847f6 (patch)
tree11b1fbd0ed544edd8ba22a486cb9df37a53f8ba8
parent5747b0d3ed2a658a5a452e29aefba1aea5debc04 (diff)
downloadgitlab-ce-fix-optimistic-locking-for-destroy.tar.gz
Use Arel to avoid MySQL triple quotingfix-optimistic-locking-for-destroy
-rw-r--r--config/initializers/ar_monkey_patch.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/config/initializers/ar_monkey_patch.rb b/config/initializers/ar_monkey_patch.rb
index 5506873344f..6979f4641b0 100644
--- a/config/initializers/ar_monkey_patch.rb
+++ b/config/initializers/ar_monkey_patch.rb
@@ -59,8 +59,7 @@ module ActiveRecord
return super unless locking_enabled?
column_name = self.class.locking_column
- table_name = self.class.quoted_table_name
- super.where("#{table_name}.#{column_name}" => self[column_name])
+ super.where(self.class.arel_table[column_name].eq(self[column_name]))
end
end