aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-06-17 14:57:55 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-06-17 14:57:55 -0300
commit63b347df427ed2189fac7e75e36a3a4b9f6c2a68 (patch)
tree59278a753e92ff7a0e4ccc60ecdf87ce80d849e3 /activerecord/test
parente7a8fda0336fe733adbdd0bdb642a09327ef22f1 (diff)
parente30d701afe08acaa1c04da50791f07d4bb4efa83 (diff)
downloadrails-63b347df427ed2189fac7e75e36a3a4b9f6c2a68.tar.gz
rails-63b347df427ed2189fac7e75e36a3a4b9f6c2a68.tar.bz2
rails-63b347df427ed2189fac7e75e36a3a4b9f6c2a68.zip
Merge pull request #15771 from sgrif/sg-stop-messing-with-column-defaults
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