Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
4c440a54
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,发现更多精彩内容 >>
提交
4c440a54
编写于
9月 05, 2014
作者:
S
Santiago Pastorino
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #16815 from seuros/ar-freeze-adapter-name
Freeze ADAPTER_NAME in adapters
上级
a8827cb9
1fc9ddbd
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
6 addition
and
17 deletion
+6
-17
activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
...lib/active_record/connection_adapters/abstract_adapter.rb
+2
-1
activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
...tive_record/connection_adapters/abstract_mysql_adapter.rb
+0
-4
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
+1
-1
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
...b/active_record/connection_adapters/postgresql_adapter.rb
+1
-6
activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
.../lib/active_record/connection_adapters/sqlite3_adapter.rb
+1
-4
未找到文件。
activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
浏览文件 @
4c440a54
...
...
@@ -66,6 +66,7 @@ module ConnectionAdapters # :nodoc:
# Most of the methods in the adapter are useful during migrations. Most
# notably, the instance methods provided by SchemaStatement are very useful.
class
AbstractAdapter
ADAPTER_NAME
=
'Abstract'
.
freeze
include
Quoting
,
DatabaseStatements
,
SchemaStatements
include
DatabaseLimits
include
QueryCache
...
...
@@ -167,7 +168,7 @@ def unprepared_statement
# Returns the human-readable name of the adapter. Use mixed case - one
# can always use downcase if needed.
def
adapter_name
'Abstract'
self
.
class
::
ADAPTER_NAME
end
# Does this adapter support migrations?
...
...
activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
浏览文件 @
4c440a54
...
...
@@ -162,10 +162,6 @@ def initialize(connection, logger, connection_options, config)
end
end
def
adapter_name
#:nodoc:
self
.
class
::
ADAPTER_NAME
end
# Returns true, since this connection adapter supports migrations.
def
supports_migrations?
true
...
...
activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb
浏览文件 @
4c440a54
...
...
@@ -29,7 +29,7 @@ def mysql2_connection(config)
module
ConnectionAdapters
class
Mysql2Adapter
<
AbstractMysqlAdapter
ADAPTER_NAME
=
'Mysql2'
ADAPTER_NAME
=
'Mysql2'
.
freeze
def
initialize
(
connection
,
logger
,
connection_options
,
config
)
super
...
...
activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
浏览文件 @
4c440a54
...
...
@@ -66,7 +66,7 @@ module ConnectionAdapters
# * <tt>:sslcipher</tt> - Necessary to use MySQL with an SSL connection.
#
class
MysqlAdapter
<
AbstractMysqlAdapter
ADAPTER_NAME
=
'MySQL'
ADAPTER_NAME
=
'MySQL'
.
freeze
class
StatementPool
<
ConnectionAdapters
::
StatementPool
def
initialize
(
connection
,
max
=
1000
)
...
...
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
浏览文件 @
4c440a54
...
...
@@ -74,7 +74,7 @@ module ConnectionAdapters
# In addition, default connection parameters of libpq can be set per environment variables.
# See http://www.postgresql.org/docs/9.1/static/libpq-envars.html .
class
PostgreSQLAdapter
<
AbstractAdapter
ADAPTER_NAME
=
'PostgreSQL'
ADAPTER_NAME
=
'PostgreSQL'
.
freeze
NATIVE_DATABASE_TYPES
=
{
primary_key:
"serial primary key"
,
...
...
@@ -118,11 +118,6 @@ class PostgreSQLAdapter < AbstractAdapter
include
PostgreSQL
::
DatabaseStatements
include
Savepoints
# Returns 'PostgreSQL' as adapter name for identification purposes.
def
adapter_name
ADAPTER_NAME
end
def
schema_creation
# :nodoc:
PostgreSQL
::
SchemaCreation
.
new
self
end
...
...
activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
浏览文件 @
4c440a54
...
...
@@ -67,6 +67,7 @@ def type_cast_for_database(value)
#
# * <tt>:database</tt> - Path to the database file.
class
SQLite3Adapter
<
AbstractAdapter
ADAPTER_NAME
=
'SQLite'
.
freeze
include
Savepoints
NATIVE_DATABASE_TYPES
=
{
...
...
@@ -147,10 +148,6 @@ def initialize(connection, logger, connection_options, config)
end
end
def
adapter_name
#:nodoc:
'SQLite'
end
def
supports_ddl_transactions?
true
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录