From 7814cd267616eb88ff8963c6e9202c1fe3dadf29 Mon Sep 17 00:00:00 2001 From: Christopher Meiklejohn Date: Mon, 14 Mar 2011 22:19:47 -0400 Subject: [PATCH] Don't quote ID's as Arel will quote them -- follow same conventions as the delete method. --- .../lib/active_record/locking/optimistic.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/activerecord/lib/active_record/locking/optimistic.rb b/activerecord/lib/active_record/locking/optimistic.rb index 6b2b1eb..a22c6dc 100644 --- a/activerecord/lib/active_record/locking/optimistic.rb +++ b/activerecord/lib/active_record/locking/optimistic.rb @@ -94,7 +94,7 @@ module ActiveRecord relation = self.class.unscoped stmt = relation.where( - relation.table[self.class.primary_key].eq(quoted_id).and( + relation.table[self.class.primary_key].eq(id).and( relation.table[lock_col].eq(quote_value(previous_lock_value)) ) ).arel.compile_update(arel_attributes_values(false, false, attribute_names)) -- 1.7.4.1