diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-12-22 11:26:03 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-12-22 11:26:03 +0000 |
commit | 8b5f4e474f30560da85f52dd64dc3b45d0338b93 (patch) | |
tree | 0ba6fdc63093d9cc5549498d9f62238bea80a4cf /activerecord/lib/active_record/connection_adapters | |
parent | dc901ced448179d9dfec924e22d8444b1a75265c (diff) | |
download | rails-8b5f4e474f30560da85f52dd64dc3b45d0338b93.tar.gz rails-8b5f4e474f30560da85f52dd64dc3b45d0338b93.tar.bz2 rails-8b5f4e474f30560da85f52dd64dc3b45d0338b93.zip |
Ruby 1.9 compat: fix warnings, shadowed block vars, and unitialized instance vars
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8481 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
3 files changed, 4 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb b/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb index 51b90d3c64..d950181566 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb @@ -71,7 +71,7 @@ module ActiveRecord # also be used to "borrow" the connection to do database work unrelated # to any of the specific Active Records. def connection - if @active_connection_name && (conn = active_connections[@active_connection_name]) + if defined?(@active_connection_name) && (conn = active_connections[@active_connection_name]) conn else # retrieve_connection sets the cache key. diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb index b8a6b19f04..48ff9de1cf 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb @@ -192,14 +192,14 @@ module ActiveRecord end def fallback_string_to_date(string) - new_date *ParseDate.parsedate(string)[0..2] + new_date(*ParseDate.parsedate(string)[0..2]) end def fallback_string_to_time(string) time_hash = Date._parse(string) time_hash[:sec_fraction] = microseconds(time_hash) - new_time *time_hash.values_at(:year, :mon, :mday, :hour, :min, :sec, :sec_fraction) + new_time(*time_hash.values_at(:year, :mon, :mday, :hour, :min, :sec, :sec_fraction)) end end diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb index 940707a9e9..e223baadbc 100755 --- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb @@ -30,6 +30,7 @@ module ActiveRecord @connection, @logger = connection, logger @runtime = 0 @last_verification = 0 + @query_cache_enabled = false end # Returns the human-readable name of the adapter. Use mixed case - one |