diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-04 12:15:30 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-04 18:14:59 -0800 |
commit | 0cd42864e3dcba520980f952be9a09c01beddb03 (patch) | |
tree | 958a5c1704c1c7deccc0ec61696c2b5126930626 /activerecord/test | |
parent | 5f3cf4244de4fd62049d08df4e6bf63c945ab90e (diff) | |
download | rails-0cd42864e3dcba520980f952be9a09c01beddb03.tar.gz rails-0cd42864e3dcba520980f952be9a09c01beddb03.tar.bz2 rails-0cd42864e3dcba520980f952be9a09c01beddb03.zip |
making sure primary key is set on the columns
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/connection_pool_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/cases/connection_pool_test.rb b/activerecord/test/cases/connection_pool_test.rb index 27fc3cab49..0727e86705 100644 --- a/activerecord/test/cases/connection_pool_test.rb +++ b/activerecord/test/cases/connection_pool_test.rb @@ -38,6 +38,15 @@ module ActiveRecord assert_equal 'id', @pool.primary_keys['omgponies'] end + def test_primary_key_is_set_on_columns + posts_columns = @pool.columns_hash['posts'] + assert posts_columns['id'].primary + + (posts_columns.keys - ['id']).each do |key| + assert !posts_columns[key].primary + end + end + def test_clear_stale_cached_connections! pool = ConnectionPool.new ActiveRecord::Base.connection_pool.spec |