提交 79af9e93 编写于 作者: F Francesco Rodriguez

nodoc AR::ConnectionHandling for adapters [ci skip]

上级 65d681f5
......@@ -4,7 +4,7 @@
require 'mysql2'
module ActiveRecord
module ConnectionHandling
module ConnectionHandling # :nodoc:
# Establishes a connection to the database that's used by all Active Record objects.
def mysql2_connection(config)
config = config.symbolize_keys
......
......@@ -16,9 +16,9 @@ class Result; include Enumerable end
end
module ActiveRecord
module ConnectionHandling
module ConnectionHandling # :nodoc:
# Establishes a connection to the database that's used by all Active Record objects.
def mysql_connection(config) # :nodoc:
def mysql_connection(config)
config = config.symbolize_keys
host = config[:host]
port = config[:port]
......
......@@ -16,7 +16,7 @@
require 'ipaddr'
module ActiveRecord
module ConnectionHandling
module ConnectionHandling # :nodoc:
VALID_CONN_PARAMS = [:host, :hostaddr, :port, :dbname, :user, :password, :connect_timeout,
:client_encoding, :options, :application_name, :fallback_application_name,
:keepalives, :keepalives_idle, :keepalives_interval, :keepalives_count,
......@@ -24,7 +24,7 @@ module ConnectionHandling
:requirepeer, :krbsrvname, :gsslib, :service]
# Establishes a connection to the database that's used by all Active Record objects
def postgresql_connection(config) # :nodoc:
def postgresql_connection(config)
conn_params = config.symbolize_keys
conn_params.delete_if { |_, v| v.nil? }
......
......@@ -6,9 +6,9 @@
require 'sqlite3'
module ActiveRecord
module ConnectionHandling
module ConnectionHandling # :nodoc:
# sqlite3 adapter reuses sqlite_connection.
def sqlite3_connection(config) # :nodoc:
def sqlite3_connection(config)
# Require database.
unless config[:database]
raise ArgumentError, "No database file specified. Missing argument: database"
......
......@@ -15,15 +15,15 @@ module ConnectionHandling
# Example for SQLite database:
#
# ActiveRecord::Base.establish_connection(
# adapter: "sqlite",
# database: "path/to/dbfile"
# adapter: "sqlite",
# database: "path/to/dbfile"
# )
#
# Also accepts keys as strings (for parsing from YAML for example):
#
# ActiveRecord::Base.establish_connection(
# "adapter" => "sqlite",
# "database" => "path/to/dbfile"
# "adapter" => "sqlite",
# "database" => "path/to/dbfile"
# )
#
# Or a URL:
......@@ -79,7 +79,7 @@ def retrieve_connection
connection_handler.retrieve_connection(self)
end
# Returns true if Active Record is connected.
# Returns +true+ if Active Record is connected.
def connected?
connection_handler.connected?(self)
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册