提交 83f7f4f0 编写于 作者: M Matthew Draper 提交者: GitHub

Merge pull request #28167 from kirs/deprecate-verify-args

Deprecate AbstractAdapter#verify! with arguments
......@@ -439,6 +439,9 @@ def requires_reloading?
# This is done under the hood by calling #active?. If the connection
# is no longer active, then this method will reconnect to the database.
def verify!(*ignored)
if ignored.size > 0
ActiveSupport::Deprecation.warn("Passing arguments to #verify method of the connection has no affect and has been deprecated. Please remove all arguments from the #verify method call.")
end
reconnect! unless active?
end
......
......@@ -63,6 +63,18 @@ def test_successful_reconnection_after_timeout_with_verify
assert @connection.active?
end
def test_verify_with_args_is_deprecated
assert_deprecated do
@connection.verify!(option: true)
end
assert_deprecated do
@connection.verify!([])
end
assert_deprecated do
@connection.verify!({})
end
end
def test_execute_after_disconnect
@connection.disconnect!
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册