mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Let's initialize instance variables in the postgres adapter.
This commit is contained in:
parent
d5921cdb7a
commit
36150c902b
2 changed files with 20 additions and 0 deletions
|
@ -218,6 +218,9 @@ module ActiveRecord
|
||||||
|
|
||||||
# @local_tz is initialized as nil to avoid warnings when connect tries to use it
|
# @local_tz is initialized as nil to avoid warnings when connect tries to use it
|
||||||
@local_tz = nil
|
@local_tz = nil
|
||||||
|
@table_alias_length = nil
|
||||||
|
@postgresql_version = nil
|
||||||
|
|
||||||
connect
|
connect
|
||||||
@local_tz = execute('SHOW TIME ZONE').first["TimeZone"]
|
@local_tz = execute('SHOW TIME ZONE').first["TimeZone"]
|
||||||
end
|
end
|
||||||
|
|
|
@ -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
|
Loading…
Reference in a new issue