aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_handling.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/connection_handling.rb')
-rw-r--r--activerecord/lib/active_record/connection_handling.rb14
1 files changed, 3 insertions, 11 deletions
diff --git a/activerecord/lib/active_record/connection_handling.rb b/activerecord/lib/active_record/connection_handling.rb
index 99fdef67d0..2ede92feff 100644
--- a/activerecord/lib/active_record/connection_handling.rb
+++ b/activerecord/lib/active_record/connection_handling.rb
@@ -73,7 +73,7 @@ module ActiveRecord
private
def config
@raw_config.dup.tap do |cfg|
- if url = ENV['DATABASE_URL']
+ if url = ENV["DATABASE_URL"]
cfg[@env] ||= {}
cfg[@env]["url"] ||= url
end
@@ -98,14 +98,6 @@ module ActiveRecord
@connection_specification_name
end
- def connection_id
- ActiveRecord::RuntimeRegistry.connection_id ||= Thread.current.object_id
- end
-
- def connection_id=(connection_id)
- ActiveRecord::RuntimeRegistry.connection_id = connection_id
- end
-
# Returns the configuration of the associated connection as a hash:
#
# ActiveRecord::Base.connection_config
@@ -117,7 +109,7 @@ module ActiveRecord
end
def connection_pool
- connection_handler.retrieve_connection_pool(connection_specification_name) or raise ConnectionNotEstablished
+ connection_handler.retrieve_connection_pool(connection_specification_name) || raise(ConnectionNotEstablished)
end
def retrieve_connection
@@ -146,6 +138,6 @@ module ActiveRecord
end
delegate :clear_active_connections!, :clear_reloadable_connections!,
- :clear_all_connections!, :to => :connection_handler
+ :clear_all_connections!, to: :connection_handler
end
end