aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2014-06-17 09:41:06 -0600
committerSean Griffin <sean@thoughtbot.com>2014-06-17 09:41:06 -0600
commite30d701afe08acaa1c04da50791f07d4bb4efa83 (patch)
tree59278a753e92ff7a0e4ccc60ecdf87ce80d849e3 /activerecord/test
parente7a8fda0336fe733adbdd0bdb642a09327ef22f1 (diff)
downloadrails-e30d701afe08acaa1c04da50791f07d4bb4efa83.tar.gz
rails-e30d701afe08acaa1c04da50791f07d4bb4efa83.tar.bz2
rails-e30d701afe08acaa1c04da50791f07d4bb4efa83.zip
Don't mess with `column_defaults` when optimistic locking is enabled
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/locking_test.rb7
1 files changed, 7 insertions, 0 deletions
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