diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2013-03-24 15:42:50 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2013-03-24 15:42:50 -0700 |
commit | 558f3204463eea80dc32b6748fe8b4174ec7ff14 (patch) | |
tree | b5090a491d4aeb062a0828d8b60567754fcc7bad /activerecord/test/cases | |
parent | 822dd1340d5f794d7b8f94733f6693125f282e8d (diff) | |
parent | a240e526a8b4c5948a1c2a8ec49b6e2d1ad6ad23 (diff) | |
download | rails-558f3204463eea80dc32b6748fe8b4174ec7ff14.tar.gz rails-558f3204463eea80dc32b6748fe8b4174ec7ff14.tar.bz2 rails-558f3204463eea80dc32b6748fe8b4174ec7ff14.zip |
Merge pull request #9489 from obrie/fix/overridden_defaults_changed_attributes
Fix ActiveRecord locking column defaults not getting persisted
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/locking_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/locking_test.rb b/activerecord/test/cases/locking_test.rb index 0c896beb1d..77891b9156 100644 --- a/activerecord/test/cases/locking_test.rb +++ b/activerecord/test/cases/locking_test.rb @@ -193,11 +193,19 @@ class OptimisticLockingTest < ActiveRecord::TestCase def test_lock_without_default_sets_version_to_zero t1 = LockWithoutDefault.new assert_equal 0, t1.lock_version + + t1.save + t1 = LockWithoutDefault.find(t1.id) + assert_equal 0, t1.lock_version end def test_lock_with_custom_column_without_default_sets_version_to_zero t1 = LockWithCustomColumnWithoutDefault.new assert_equal 0, t1.custom_lock_version + + t1.save + t1 = LockWithCustomColumnWithoutDefault.find(t1.id) + assert_equal 0, t1.custom_lock_version end def test_readonly_attributes |