Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate AbstractAdapter#verify! with arguments #28167

Merged
merged 1 commit into from
Feb 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 12 additions & 0 deletions activerecord/test/cases/adapters/mysql2/connection_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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!

Expand Down