Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
79af9e93
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
79af9e93
编写于
3月 15, 2013
作者:
F
Francesco Rodriguez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
nodoc AR::ConnectionHandling for adapters [ci skip]
上级
65d681f5
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
12 addition
and
12 deletion
+12
-12
activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb
...d/lib/active_record/connection_adapters/mysql2_adapter.rb
+1
-1
activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
...rd/lib/active_record/connection_adapters/mysql_adapter.rb
+2
-2
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
...b/active_record/connection_adapters/postgresql_adapter.rb
+2
-2
activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
.../lib/active_record/connection_adapters/sqlite3_adapter.rb
+2
-2
activerecord/lib/active_record/connection_handling.rb
activerecord/lib/active_record/connection_handling.rb
+5
-5
未找到文件。
activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb
浏览文件 @
79af9e93
...
...
@@ -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
...
...
activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
浏览文件 @
79af9e93
...
...
@@ -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
]
...
...
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
浏览文件 @
79af9e93
...
...
@@ -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?
}
...
...
activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
浏览文件 @
79af9e93
...
...
@@ -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"
...
...
activerecord/lib/active_record/connection_handling.rb
浏览文件 @
79af9e93
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录