From e30d701afe08acaa1c04da50791f07d4bb4efa83 Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Tue, 17 Jun 2014 09:41:06 -0600 Subject: Don't mess with `column_defaults` when optimistic locking is enabled --- activerecord/test/cases/locking_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'activerecord/test') diff --git a/activerecord/test/cases/locking_test.rb b/activerecord/test/cases/locking_test.rb index c221430757..0c9dff2c25 100644 --- a/activerecord/test/cases/locking_test.rb +++ b/activerecord/test/cases/locking_test.rb @@ -272,6 +272,13 @@ class OptimisticLockingTest < ActiveRecord::TestCase assert p.treasures.empty? assert RichPerson.connection.select_all("SELECT * FROM peoples_treasures WHERE rich_person_id = 1").empty? end + + def test_yaml_dumping_with_lock_column + t1 = LockWithoutDefault.new + t2 = YAML.load(YAML.dump(t1)) + + assert_equal t1.attributes, t2.attributes + end end class OptimisticLockingWithSchemaChangeTest < ActiveRecord::TestCase -- cgit v1.2.3