From 4d1264cb5afb93dba198dc559c22a88521fc45c4 Mon Sep 17 00:00:00 2001 From: bogdanvlviv Date: Fri, 28 Apr 2017 00:23:50 +0300 Subject: Fix ActiveRecord::Persistence#touch with locking `ActiveRecord::Persistence#touch` does not work well when optimistic locking enabled and `locking_column`, without default value, is null in the database. --- activerecord/test/schema/schema.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activerecord/test/schema/schema.rb') diff --git a/activerecord/test/schema/schema.rb b/activerecord/test/schema/schema.rb index dc8bdb98ff..6da0ef26f6 100644 --- a/activerecord/test/schema/schema.rb +++ b/activerecord/test/schema/schema.rb @@ -453,11 +453,13 @@ ActiveRecord::Schema.define do create_table :lock_without_defaults, force: true do |t| t.column :title, :string t.column :lock_version, :integer + t.timestamps null: true end create_table :lock_without_defaults_cust, force: true do |t| t.column :title, :string t.column :custom_lock_version, :integer + t.timestamps null: true end create_table :magazines, force: true do |t| -- cgit v1.2.3