diff options
author | Michael Koziarski <michael@koziarski.com> | 2006-01-14 09:36:52 +0000 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2006-01-14 09:36:52 +0000 |
commit | a471e6b4d741c498439767237efad9838df44834 (patch) | |
tree | 430eee828fff690cc1d1174f355e29d4822bfb4b /activerecord/test/locking_test.rb | |
parent | 62d749ab0ef1787e050537bd9a6f833b30f1331d (diff) | |
download | rails-a471e6b4d741c498439767237efad9838df44834.tar.gz rails-a471e6b4d741c498439767237efad9838df44834.tar.bz2 rails-a471e6b4d741c498439767237efad9838df44834.zip |
allow the 'lock_version' column to be configured with set_locking_column. Closes #3402
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3422 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/locking_test.rb')
-rw-r--r-- | activerecord/test/locking_test.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/activerecord/test/locking_test.rb b/activerecord/test/locking_test.rb index a88abc8200..105f19f2bc 100644 --- a/activerecord/test/locking_test.rb +++ b/activerecord/test/locking_test.rb @@ -1,8 +1,9 @@ require 'abstract_unit' require 'fixtures/person' +require 'fixtures/legacy_thing' class LockingTest < Test::Unit::TestCase - fixtures :people + fixtures :people, :legacy_things def test_lock_existing p1 = Person.find(1) @@ -28,5 +29,18 @@ class LockingTest < Test::Unit::TestCase p2.first_name = "should fail" p2.save } + end + + def test_lock_column_name_existing + t1 = LegacyThing.find(1) + t2 = LegacyThing.find(1) + t1.tps_report_number = 400 + t1.save + + assert_raises(ActiveRecord::StaleObjectError) { + t2.tps_report_number = 300 + t2.save + } end + end |