From 4fbd8adf4824d48aea47a57047d90fb6510cee28 Mon Sep 17 00:00:00 2001 From: Christopher Meiklejohn Date: Mon, 14 Mar 2011 22:19:47 -0400 Subject: Don't quote ID's as Arel will quote them -- follow same conventions as the delete method. --- activerecord/lib/active_record/locking/optimistic.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/locking') diff --git a/activerecord/lib/active_record/locking/optimistic.rb b/activerecord/lib/active_record/locking/optimistic.rb index 9a31675782..cdedcde0eb 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)) -- cgit v1.2.3