Remove deprecated `name` argument from `#tables`

上级 e646bad5
* 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*
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册