diff options
Diffstat (limited to 'activerecord/lib/active_record/locking/optimistic.rb')
-rw-r--r-- | activerecord/lib/active_record/locking/optimistic.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/locking/optimistic.rb b/activerecord/lib/active_record/locking/optimistic.rb index 9fcdabdb44..bf0683eb8f 100644 --- a/activerecord/lib/active_record/locking/optimistic.rb +++ b/activerecord/lib/active_record/locking/optimistic.rb @@ -81,8 +81,8 @@ module ActiveRecord relation = self.class.unscoped affected_rows = relation.where( - relation[self.class.primary_key].eq(quoted_id).and( - relation[self.class.locking_column].eq(quote_value(previous_value)) + relation.table[self.class.primary_key].eq(quoted_id).and( + relation.table[self.class.locking_column].eq(quote_value(previous_value)) ) ).update(arel_attributes_values(false, false, attribute_names)) |