diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-18 22:24:45 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-18 22:24:45 -0300 |
commit | a82f1e3f5d11c8dfba9f4c911745ec40a7965216 (patch) | |
tree | 9a44a97c364d0404b0da1ac2f786d2ce4a7980d2 /activerecord/test/cases/dirty_test.rb | |
parent | 29ebec702d0dc5ce2d760f61292460f77207c87e (diff) | |
download | rails-a82f1e3f5d11c8dfba9f4c911745ec40a7965216.tar.gz rails-a82f1e3f5d11c8dfba9f4c911745ec40a7965216.tar.bz2 rails-a82f1e3f5d11c8dfba9f4c911745ec40a7965216.zip |
Cache columns metadata to avoid extra while testing
Diffstat (limited to 'activerecord/test/cases/dirty_test.rb')
-rw-r--r-- | activerecord/test/cases/dirty_test.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/test/cases/dirty_test.rb b/activerecord/test/cases/dirty_test.rb index 3bd2e909d7..e1129704a6 100644 --- a/activerecord/test/cases/dirty_test.rb +++ b/activerecord/test/cases/dirty_test.rb @@ -325,6 +325,8 @@ class DirtyTest < ActiveRecord::TestCase end def test_partial_update_with_optimistic_locking + Person.first # cache metadata in advance to avoid extra sql statements executed while testing + person = Person.new(:first_name => 'foo') old_lock_version = 1 @@ -530,7 +532,7 @@ class DirtyTest < ActiveRecord::TestCase pirate = target.create(:created_on => created_on) pirate.reload # Here mysql truncate the usec value to 0 - + pirate.created_on = created_on assert !pirate.created_on_changed? end |