From 16e4a53b78aacc78712ff6ad4aa2da3a69faff5c Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Thu, 4 Oct 2012 21:57:44 +0200 Subject: PostgreSQL, quote table names when fetching the primary key. Closes #5920 --- .../test/cases/adapters/postgresql/postgresql_adapter_test.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activerecord/test') diff --git a/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb b/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb index 92e31a3e44..f1362dd15f 100644 --- a/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb +++ b/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb @@ -14,6 +14,10 @@ module ActiveRecord assert_equal 'id', @connection.primary_key('ex') end + def test_primary_key_works_tables_containing_capital_letters + assert_equal 'id', @connection.primary_key('CamelCase') + end + def test_non_standard_primary_key @connection.exec_query('drop table if exists ex') @connection.exec_query('create table ex(data character varying(255) primary key)') -- cgit v1.2.3