This project is archived and is in readonly mode.

#6578 new
Christopher Meiklejohn

Optimistic Locking and Double Quoting of Strings

Reported by Christopher Meiklejohn | March 15th, 2011 @ 02:26 AM

Follow up to: https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets..., as I wasn't able to comment on that ticket (updates kept disappearing).

Reported by: Alexander Gorkunov

Content:

In: activerecord/lib/active_record/locking/optimistic.rb

line 91:

relation.table[self.class.primary_key].eq(quoted_id).and(

quoted_id is superfluous because it quoted in arel engine.
So in compiled SQL we get : '''id''' instead of 'id'
This problem has already fixed in destroy statement (see line 117)

--

Included is a patch to resolve this issue. The delete method uses ID, not quoted ID, as ARel will quote it.

Follow this same convention.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Pages