Skip to content
Browse files

Let's initialize instance variables in the postgres adapter.

  • Loading branch information...
1 parent d5921cd commit 36150c902b3253101aaa2e14ed31d8d8b9a2e0d2 @tenderlove tenderlove committed Jul 14, 2010
View
3 activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -218,6 +218,9 @@ def initialize(connection, logger, connection_parameters, config)
# @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
View
17 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

0 comments on commit 36150c9

Please sign in to comment.
Something went wrong with that request. Please try again.