Use Arel to avoid MySQL triple quoting

This commit is contained in:
Lin Jen-Shin 2016-12-01 17:17:04 +08:00
parent 5747b0d3ed
commit 7839aa55f5
1 changed files with 1 additions and 2 deletions

View File

@ -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