Skip to content

Commit 6fd9298

Browse files
committed
No private def in the codebase
1 parent b122345 commit 6fd9298

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ class AbstractMysqlAdapter < AbstractAdapter
4343
}
4444

4545
class StatementPool < ConnectionAdapters::StatementPool # :nodoc:
46-
private def dealloc(stmt)
47-
stmt.close
48-
end
46+
private
47+
48+
def dealloc(stmt)
49+
stmt.close
50+
end
4951
end
5052

5153
def initialize(connection, logger, connection_options, config)

activerecord/test/cases/query_cache_test.rb

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,6 @@ def test_exceptional_middleware_clears_and_disables_cache_on_error
5555
assert_cache :off
5656
end
5757

58-
private def with_temporary_connection_pool
59-
old_pool = ActiveRecord::Base.connection_handler.retrieve_connection_pool(ActiveRecord::Base.connection_specification_name)
60-
new_pool = ActiveRecord::ConnectionAdapters::ConnectionPool.new ActiveRecord::Base.connection_pool.spec
61-
ActiveRecord::Base.connection_handler.send(:owner_to_pool)["primary"] = new_pool
62-
63-
yield
64-
ensure
65-
ActiveRecord::Base.connection_handler.send(:owner_to_pool)["primary"] = old_pool
66-
end
67-
6858
def test_query_cache_across_threads
6959
with_temporary_connection_pool do
7060
begin
@@ -495,6 +485,17 @@ def test_query_cache_is_enabled_on_all_connection_pools
495485
end
496486

497487
private
488+
489+
def with_temporary_connection_pool
490+
old_pool = ActiveRecord::Base.connection_handler.retrieve_connection_pool(ActiveRecord::Base.connection_specification_name)
491+
new_pool = ActiveRecord::ConnectionAdapters::ConnectionPool.new ActiveRecord::Base.connection_pool.spec
492+
ActiveRecord::Base.connection_handler.send(:owner_to_pool)["primary"] = new_pool
493+
494+
yield
495+
ensure
496+
ActiveRecord::Base.connection_handler.send(:owner_to_pool)["primary"] = old_pool
497+
end
498+
498499
def middleware(&app)
499500
executor = Class.new(ActiveSupport::Executor)
500501
ActiveRecord::QueryCache.install_executor_hooks executor

0 commit comments

Comments
 (0)