提交 a444ea34 编写于 作者: Y Yves Senn

remove deprecated `ActiveRecord::Base#connection` method.

上级 53394420
* Remove deprecated `ActiveRecord::Base#connection` method.
Make sure to access it via the class.
*Yves Senn*
* Remove deprecation warning for `auto_explain_threshold_in_seconds`.
*Yves Senn*
......
......@@ -337,14 +337,6 @@ def readonly!
@readonly = true
end
# Returns the connection currently associated with the class. This can
# also be used to "borrow" the connection to do database work that isn't
# easily done without going straight to SQL.
def connection
ActiveSupport::Deprecation.warn("#connection is deprecated in favour of accessing it via the class")
self.class.connection
end
def connection_handler
self.class.connection_handler
end
......
......@@ -493,10 +493,6 @@ class CustomConnectionFixturesTest < ActiveRecord::TestCase
fixtures :courses
self.use_transactional_fixtures = false
def test_connection_instance_method_deprecation
assert_deprecated { courses(:ruby).connection }
end
def test_leaky_destroy
assert_nothing_raised { courses(:ruby) }
courses(:ruby).destroy
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册