Permalink
Browse files

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

  • Loading branch information...
senny committed Jul 1, 2013
1 parent 5339442 commit a444ea3478586befdc24b8152e15dc13884a3697
Showing with 5 additions and 12 deletions.
  1. +5 −0 activerecord/CHANGELOG.md
  2. +0 −8 activerecord/lib/active_record/core.rb
  3. +0 −4 activerecord/test/cases/fixtures_test.rb
@@ -1,3 +1,8 @@
* 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

0 comments on commit a444ea3

Please sign in to comment.