From 7839aa55f57e5eb22141ed068cf43a29aac847f6 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Thu, 1 Dec 2016 17:17:04 +0800 Subject: [PATCH] Use Arel to avoid MySQL triple quoting --- config/initializers/ar_monkey_patch.rb | 3 +-- 1 file changed, 1 insertion(+), 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