Browse files

Tidy up the "Specified column type for quote_value" changes

This includes fixing typos in changelog, removing a deprecated
mocha/setup test require, and preferring the `column_for_attribute`
accessor over direct access to the columns_hash in the new code.

Conflicts:
	activerecord/CHANGELOG.md
  • Loading branch information...
1 parent 07aebf0 commit aae745bafc1921aafeafb7e1e82d6dfbc031388e @Empact Empact committed with rafaelfranca Jul 20, 2013
View
5 activerecord/CHANGELOG.md
@@ -1,9 +1,10 @@
## unreleased ##
-* When using optimisitc locking, `update` whas not passing the column type to `quote_value`
+* When using optimistic locking, `update` was not passing the column to `quote_value`
to allow the connection adapter to properly determine how to quote the value. This was
affecting certain databases that use specific colmn types.
- Fix #6763
+
+ Fixes: #6763
*Alfred Wong*
View
2 activerecord/lib/active_record/locking/optimistic.rb
@@ -82,7 +82,7 @@ def update_record(attribute_names = @attributes.keys) #:nodoc:
stmt = relation.where(
relation.table[self.class.primary_key].eq(id).and(
- relation.table[lock_col].eq(self.class.quote_value(previous_lock_value, self.class.columns_hash[lock_col]))
+ relation.table[lock_col].eq(self.class.quote_value(previous_lock_value, column_for_attribute(lock_col)))
)
).arel.compile_update(arel_attributes_with_values_for_update(attribute_names))
View
1 activerecord/test/cases/locking_test.rb
@@ -1,5 +1,4 @@
require 'thread'
-require 'mocha/setup'
require "cases/helper"
require 'models/person'
require 'models/job'

0 comments on commit aae745b

Please sign in to comment.