aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-07-14 15:04:14 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-07-14 15:04:14 -0700
commit36150c902b3253101aaa2e14ed31d8d8b9a2e0d2 (patch)
treef5931079a4b787a4d6705d0afe65c0ea9fd74244 /activerecord
parentd5921cdb7a00b393d0ba5f2f795da60a33b11cf1 (diff)
downloadrails-36150c902b3253101aaa2e14ed31d8d8b9a2e0d2.tar.gz
rails-36150c902b3253101aaa2e14ed31d8d8b9a2e0d2.tar.bz2
rails-36150c902b3253101aaa2e14ed31d8d8b9a2e0d2.zip
Let's initialize instance variables in the postgres adapter.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb3
-rw-r--r--activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb17
2 files changed, 20 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
index e213eae026..e9443fc237 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -218,6 +218,9 @@ module ActiveRecord
# @local_tz is initialized as nil to avoid warnings when connect tries to use it
@local_tz = nil
+ @table_alias_length = nil
+ @postgresql_version = nil
+
connect
@local_tz = execute('SHOW TIME ZONE').first["TimeZone"]
end
diff --git a/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb b/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb
new file mode 100644
index 0000000000..7b72151b57
--- /dev/null
+++ b/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb
@@ -0,0 +1,17 @@
+require "cases/helper"
+
+module ActiveRecord
+ module ConnectionAdapters
+ class PostgreSQLAdapterTest < ActiveRecord::TestCase
+ def setup
+ @connection = ActiveRecord::Base.connection
+ end
+
+ def test_table_alias_length
+ assert_nothing_raised do
+ @connection.table_alias_length
+ end
+ end
+ end
+ end
+end