Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
d5be101d
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,发现更多精彩内容 >>
未验证
提交
d5be101d
编写于
12月 29, 2016
作者:
R
Rafael Mendonça França
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove deprecated `name` argument from `#tables`
上级
e646bad5
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
10 addition
and
30 deletion
+10
-30
activerecord/CHANGELOG.md
activerecord/CHANGELOG.md
+4
-0
activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
..._record/connection_adapters/abstract/schema_statements.rb
+1
-1
activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
...tive_record/connection_adapters/abstract_mysql_adapter.rb
+1
-7
activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
...ecord/connection_adapters/postgresql/schema_statements.rb
+1
-7
activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
.../lib/active_record/connection_adapters/sqlite3_adapter.rb
+1
-7
activerecord/test/cases/adapter_test.rb
activerecord/test/cases/adapter_test.rb
+0
-4
activerecord/test/cases/adapters/postgresql/connection_test.rb
...erecord/test/cases/adapters/postgresql/connection_test.rb
+1
-1
activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb
...ecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb
+1
-3
未找到文件。
activerecord/CHANGELOG.md
浏览文件 @
d5be101d
*
Remove deprecated
`name`
argument from
`#tables`
.
*Rafael Mendonça França*
*
Remove deprecated support to passing a column to
`#quote`
.
*Rafael Mendonça França*
...
...
activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
浏览文件 @
d5be101d
...
...
@@ -43,7 +43,7 @@ def data_source_exists?(name)
end
# Returns an array of table names defined in the database.
def
tables
(
name
=
nil
)
def
tables
raise
NotImplementedError
,
"#tables is not implemented"
end
...
...
activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
浏览文件 @
d5be101d
...
...
@@ -310,19 +310,13 @@ def collation
show_variable
"collation_database"
end
def
tables
(
name
=
nil
)
# :nodoc:
def
tables
# :nodoc:
ActiveSupport
::
Deprecation
.
warn
(
<<-
MSG
.
squish
)
#tables currently returns both tables and views.
This behavior is deprecated and will be changed with Rails 5.1 to only return tables.
Use #data_sources instead.
MSG
if
name
ActiveSupport
::
Deprecation
.
warn
(
<<-
MSG
.
squish
)
Passing arguments to #tables is deprecated without replacement.
MSG
end
data_sources
end
...
...
activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
浏览文件 @
d5be101d
...
...
@@ -71,13 +71,7 @@ def drop_database(name) #:nodoc:
end
# Returns the list of all tables in the schema search path.
def
tables
(
name
=
nil
)
if
name
ActiveSupport
::
Deprecation
.
warn
(
<<-
MSG
.
squish
)
Passing arguments to #tables is deprecated without replacement.
MSG
end
def
tables
select_values
(
"SELECT tablename FROM pg_tables WHERE schemaname = ANY(current_schemas(false))"
,
"SCHEMA"
)
end
...
...
activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
浏览文件 @
d5be101d
...
...
@@ -259,19 +259,13 @@ def exec_rollback_db_transaction #:nodoc:
# SCHEMA STATEMENTS ========================================
def
tables
(
name
=
nil
)
# :nodoc:
def
tables
# :nodoc:
ActiveSupport
::
Deprecation
.
warn
(
<<-
MSG
.
squish
)
#tables currently returns both tables and views.
This behavior is deprecated and will be changed with Rails 5.1 to only return tables.
Use #data_sources instead.
MSG
if
name
ActiveSupport
::
Deprecation
.
warn
(
<<-
MSG
.
squish
)
Passing arguments to #tables is deprecated without replacement.
MSG
end
data_sources
end
...
...
activerecord/test/cases/adapter_test.rb
浏览文件 @
d5be101d
...
...
@@ -300,10 +300,6 @@ def test_tables_returning_both_tables_and_views_is_deprecated
assert_deprecated
{
@connection
.
tables
}
end
end
def
test_passing_arguments_to_tables_is_deprecated
assert_deprecated
{
@connection
.
tables
(
:books
)
}
end
end
class
AdapterTestWithoutTransaction
<
ActiveRecord
::
TestCase
...
...
activerecord/test/cases/adapters/postgresql/connection_test.rb
浏览文件 @
d5be101d
...
...
@@ -90,7 +90,7 @@ def test_reset_with_transaction
end
def
test_tables_logs_name
ActiveSupport
::
Deprecation
.
silence
{
@connection
.
tables
(
"hello"
)
}
@connection
.
tables
assert_equal
"SCHEMA"
,
@subscriber
.
logged
[
0
][
1
]
end
...
...
activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb
浏览文件 @
d5be101d
...
...
@@ -280,9 +280,7 @@ def test_tables_logs_name
WHERE type IN ('table','view') AND name <> 'sqlite_sequence'
SQL
assert_logged
[[
sql
.
squish
,
"SCHEMA"
,
[]]]
do
ActiveSupport
::
Deprecation
.
silence
do
@conn
.
tables
(
"hello"
)
end
@conn
.
tables
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录