diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-07-22 06:03:41 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-07-22 06:03:41 -0700 |
commit | ecd70039ba191371f3735d7a6336e4cfc6be83df (patch) | |
tree | 160eaa1cd6500ea61931851fb2918528af36f99e /activerecord/lib | |
parent | 49c8b671ecae204d7683ed7473acdaa15ac4aa63 (diff) | |
parent | 31a43ebc107fbd50e7e62567e5208a05909ec76c (diff) | |
download | rails-ecd70039ba191371f3735d7a6336e4cfc6be83df.tar.gz rails-ecd70039ba191371f3735d7a6336e4cfc6be83df.tar.bz2 rails-ecd70039ba191371f3735d7a6336e4cfc6be83df.zip |
Merge pull request #11528 from Empact/optimistic_lock_improvement
Rebase and make fixes to #6763 "Specified column type for quote_value"
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/locking/optimistic.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/sanitization.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/locking/optimistic.rb b/activerecord/lib/active_record/locking/optimistic.rb index 2a7996c4e7..626fe40103 100644 --- a/activerecord/lib/active_record/locking/optimistic.rb +++ b/activerecord/lib/active_record/locking/optimistic.rb @@ -82,7 +82,7 @@ module ActiveRecord stmt = relation.where( relation.table[self.class.primary_key].eq(id).and( - relation.table[lock_col].eq(self.class.quote_value(previous_lock_value)) + 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)) diff --git a/activerecord/lib/active_record/sanitization.rb b/activerecord/lib/active_record/sanitization.rb index 31e294022f..0b87ab9926 100644 --- a/activerecord/lib/active_record/sanitization.rb +++ b/activerecord/lib/active_record/sanitization.rb @@ -3,8 +3,8 @@ module ActiveRecord extend ActiveSupport::Concern module ClassMethods - def quote_value(value, column = nil) #:nodoc: - connection.quote(value,column) + def quote_value(value, column) #:nodoc: + connection.quote(value, column) end # Used to sanitize objects before they're used in an SQL SELECT statement. Delegates to <tt>connection.quote</tt>. |